-#include "../../grammar/grammar_crt.h"\r
-#include "../../grammar/grammar_crt.c"\r
-#include <stdio.h>\r
-\r
-static const char *slang_shader_syn =\r
-#include "slang_shader_syn.h"\r
-;\r
-\r
-static void gc_to_bin (grammar id, const char *in, const char *out)\r
-{\r
- FILE *f;\r
- byte *source, *prod;\r
- unsigned int size, i, line = 0;\r
-\r
- printf ("Precompiling %s\n", in);\r
-\r
- f = fopen (in, "r");\r
- if (f == NULL)\r
- return;\r
- fseek (f, 0, SEEK_END);\r
- size = ftell (f);\r
- fseek (f, 0, SEEK_SET);\r
- source = (byte *) grammar_alloc_malloc (size + 1);\r
- source[fread (source, 1, size, f)] = '\0';\r
- fclose (f);\r
-\r
- if (!grammar_fast_check (id, source, &prod, &size, 65536))\r
- {\r
- grammar_alloc_free (source);\r
- return;\r
- }\r
-\r
- f = fopen (out, "w");\r
- fprintf (f, "\n");\r
- fprintf (f, "/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\n");\r
- fprintf (f, "/* %s */\n", in);\r
- fprintf (f, "\n");\r
- for (i = 0; i < size; i++)\r
- {\r
- unsigned int a;\r
- if (prod[i] < 10)\r
- a = 1;\r
- else if (prod[i] < 100)\r
- a = 2;\r
- else\r
- a = 3;\r
- if (i < size - 1)\r
- a++;\r
- if (line + a >= 100)\r
- {\r
- fprintf (f, "\n");\r
- line = 0;\r
- }\r
- line += a;\r
- fprintf (f, "%d", prod[i]);\r
- if (i < size - 1)\r
- fprintf (f, ",");\r
- }\r
- fprintf (f, "\n");\r
- fclose (f);\r
- grammar_alloc_free (prod);\r
-}\r
-\r
-int main ()\r
-{\r
- grammar id;\r
-\r
- id = grammar_load_from_text ((const byte *) slang_shader_syn);\r
- if (id == 0)\r
- return 1;\r
-\r
- grammar_set_reg8 (id, (const byte *) "parsing_builtin", 1);\r
-\r
- grammar_set_reg8 (id, (const byte *) "shader_type", 1);\r
- gc_to_bin (id, "slang_core.gc", "slang_core_gc.h");\r
- gc_to_bin (id, "slang_common_builtin.gc", "slang_common_builtin_gc.h");\r
- gc_to_bin (id, "slang_fragment_builtin.gc", "slang_fragment_builtin_gc.h");\r
-\r
- grammar_set_reg8 (id, (const byte *) "shader_type", 2);\r
- gc_to_bin (id, "slang_vertex_builtin.gc", "slang_vertex_builtin_gc.h");\r
-\r
- grammar_destroy (id);\r
-\r
- return 0;\r
-}\r
-\r
+#include "../../grammar/grammar_crt.h"
+#include "../../grammar/grammar_crt.c"
+#include <stdio.h>
+
+static const char *slang_shader_syn =
+#include "slang_shader_syn.h"
+;
+
+static void gc_to_bin (grammar id, const char *in, const char *out)
+{
+ FILE *f;
+ byte *source, *prod;
+ unsigned int size, i, line = 0;
+
+ printf ("Precompiling %s\n", in);
+
+ f = fopen (in, "r");
+ if (f == NULL)
+ return;
+ fseek (f, 0, SEEK_END);
+ size = ftell (f);
+ fseek (f, 0, SEEK_SET);
+ source = (byte *) grammar_alloc_malloc (size + 1);
+ source[fread (source, 1, size, f)] = '\0';
+ fclose (f);
+
+ if (!grammar_fast_check (id, source, &prod, &size, 65536))
+ {
+ grammar_alloc_free (source);
+ return;
+ }
+
+ f = fopen (out, "w");
+ fprintf (f, "\n");
+ fprintf (f, "/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\n");
+ fprintf (f, "/* %s */\n", in);
+ fprintf (f, "\n");
+ for (i = 0; i < size; i++)
+ {
+ unsigned int a;
+ if (prod[i] < 10)
+ a = 1;
+ else if (prod[i] < 100)
+ a = 2;
+ else
+ a = 3;
+ if (i < size - 1)
+ a++;
+ if (line + a >= 100)
+ {
+ fprintf (f, "\n");
+ line = 0;
+ }
+ line += a;
+ fprintf (f, "%d", prod[i]);
+ if (i < size - 1)
+ fprintf (f, ",");
+ }
+ fprintf (f, "\n");
+ fclose (f);
+ grammar_alloc_free (prod);
+}
+
+int main ()
+{
+ grammar id;
+
+ id = grammar_load_from_text ((const byte *) slang_shader_syn);
+ if (id == 0)
+ return 1;
+
+ grammar_set_reg8 (id, (const byte *) "parsing_builtin", 1);
+
+ grammar_set_reg8 (id, (const byte *) "shader_type", 1);
+ gc_to_bin (id, "slang_core.gc", "slang_core_gc.h");
+ gc_to_bin (id, "slang_common_builtin.gc", "slang_common_builtin_gc.h");
+ gc_to_bin (id, "slang_fragment_builtin.gc", "slang_fragment_builtin_gc.h");
+
+ grammar_set_reg8 (id, (const byte *) "shader_type", 2);
+ gc_to_bin (id, "slang_vertex_builtin.gc", "slang_vertex_builtin_gc.h");
+
+ grammar_destroy (id);
+
+ return 0;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
//
// From Shader Spec, ver. 1.10, rev. 59
//
float radians (float deg) {
return 3.141593 * deg / 180.0;
-}\r
+}
vec2 radians (vec2 deg) {
return vec2 (3.141593) * deg / vec2 (180.0);
-}\r
+}
vec3 radians (vec3 deg) {
return vec3 (3.141593) * deg / vec3 (180.0);
-}\r
+}
vec4 radians (vec4 deg) {
return vec4 (3.141593) * deg / vec4 (180.0);
float degrees (float rad) {
return 180.0 * rad / 3.141593;
-}\r
+}
vec2 degrees (vec2 rad) {
return vec2 (180.0) * rad / vec2 (3.141593);
-}\r
+}
vec3 degrees (vec3 rad) {
return vec3 (180.0) * rad / vec3 (3.141593);
-}\r
+}
vec4 degrees (vec4 rad) {
return vec4 (180.0) * rad / vec4 (3.141593);
}
-float sin (float angle) {\r
- float x;\r
+float sin (float angle) {
+ float x;
__asm float_sine x, angle;
return x;
-}\r
+}
vec2 sin (vec2 angle) {
- return vec2 (\r
- sin (angle.x),\r
- sin (angle.y)\r
- );\r
-}\r
+ return vec2 (
+ sin (angle.x),
+ sin (angle.y)
+ );
+}
vec3 sin (vec3 angle) {
- return vec3 (\r
- sin (angle.x),\r
- sin (angle.y),\r
- sin (angle.z)\r
+ return vec3 (
+ sin (angle.x),
+ sin (angle.y),
+ sin (angle.z)
);
-}\r
+}
vec4 sin (vec4 angle) {
- return vec4 (\r
- sin (angle.x),\r
- sin (angle.y),\r
- sin (angle.z),\r
- sin (angle.w)\r
+ return vec4 (
+ sin (angle.x),
+ sin (angle.y),
+ sin (angle.z),
+ sin (angle.w)
);
}
float cos (float angle) {
return sin (angle + 1.5708);
-}\r
+}
vec2 cos (vec2 angle) {
- return vec2 (\r
- cos (angle.x),\r
- cos (angle.y)\r
+ return vec2 (
+ cos (angle.x),
+ cos (angle.y)
);
-}\r
+}
vec3 cos (vec3 angle) {
- return vec3 (\r
- cos (angle.x),\r
- cos (angle.y),\r
- cos (angle.z)\r
+ return vec3 (
+ cos (angle.x),
+ cos (angle.y),
+ cos (angle.z)
);
-}\r
+}
vec4 cos (vec4 angle) {
- return vec4 (\r
- cos (angle.x),\r
- cos (angle.y),\r
- cos (angle.z),\r
- cos (angle.w)\r
+ return vec4 (
+ cos (angle.x),
+ cos (angle.y),
+ cos (angle.z),
+ cos (angle.w)
);
}
float tan (float angle) {
return sin (angle) / cos (angle);
-}\r
+}
vec2 tan (vec2 angle) {
- return vec2 (\r
- tan (angle.x),\r
- tan (angle.y)\r
+ return vec2 (
+ tan (angle.x),
+ tan (angle.y)
);
-}\r
+}
vec3 tan (vec3 angle) {
- return vec3 (\r
- tan (angle.x),\r
- tan (angle.y),\r
- tan (angle.z)\r
+ return vec3 (
+ tan (angle.x),
+ tan (angle.y),
+ tan (angle.z)
);
-}\r
+}
vec4 tan (vec4 angle) {
- return vec4 (\r
- tan (angle.x),\r
- tan (angle.y),\r
- tan (angle.z),\r
- tan (angle.w)\r
+ return vec4 (
+ tan (angle.x),
+ tan (angle.y),
+ tan (angle.z),
+ tan (angle.w)
);
}
float asin (float x) {
- float y;\r
- __asm float_arcsine y, x;\r
+ float y;
+ __asm float_arcsine y, x;
return y;
-}\r
+}
vec2 asin (vec2 v) {
- return vec2 (\r
- asin (v.x),\r
- asin (v.y)\r
+ return vec2 (
+ asin (v.x),
+ asin (v.y)
);
-}\r
+}
vec3 asin (vec3 v) {
- return vec3 (\r
- asin (v.x),\r
- asin (v.y),\r
- asin (v.z)\r
+ return vec3 (
+ asin (v.x),
+ asin (v.y),
+ asin (v.z)
);
-}\r
+}
vec4 asin (vec4 v) {
- return vec4 (\r
- asin (v.x),\r
- asin (v.y),\r
- asin (v.z),\r
- asin (v.w)\r
+ return vec4 (
+ asin (v.x),
+ asin (v.y),
+ asin (v.z),
+ asin (v.w)
);
}
float acos (float x) {
return 1.5708 - asin (x);
-}\r
+}
vec2 acos (vec2 v) {
- return vec2 (\r
- acos (v.x),\r
- acos (v.y)\r
+ return vec2 (
+ acos (v.x),
+ acos (v.y)
);
-}\r
+}
vec3 acos (vec3 v) {
- return vec3 (\r
- acos (v.x),\r
- acos (v.y),\r
- acos (v.z)\r
+ return vec3 (
+ acos (v.x),
+ acos (v.y),
+ acos (v.z)
);
-}\r
+}
vec4 acos (vec4 v) {
- return vec4 (\r
- acos (v.x),\r
- acos (v.y),\r
- acos (v.z),\r
- acos (v.w)\r
- );
-}
-
-float atan (float y_over_x) {\r
- float z;\r
- __asm float_arctan z, y_over_x;\r
- return z;\r
-}\r
-\r
-vec2 atan (vec2 y_over_x) {\r
- return vec2 (\r
- atan (y_over_x.x),\r
- atan (y_over_x.y)\r
- );\r
-}\r
-\r
-vec3 atan (vec3 y_over_x) {\r
- return vec3 (\r
- atan (y_over_x.x),\r
- atan (y_over_x.y),\r
- atan (y_over_x.z)\r
- );\r
-}\r
-\r
-vec4 atan (vec4 y_over_x) {\r
- return vec4 (\r
- atan (y_over_x.x),\r
- atan (y_over_x.y),\r
- atan (y_over_x.z),\r
- atan (y_over_x.w)\r
- );\r
-}\r
-\r
-float atan (float y, float x) {\r
+ return vec4 (
+ acos (v.x),
+ acos (v.y),
+ acos (v.z),
+ acos (v.w)
+ );
+}
+
+float atan (float y_over_x) {
+ float z;
+ __asm float_arctan z, y_over_x;
+ return z;
+}
+
+vec2 atan (vec2 y_over_x) {
+ return vec2 (
+ atan (y_over_x.x),
+ atan (y_over_x.y)
+ );
+}
+
+vec3 atan (vec3 y_over_x) {
+ return vec3 (
+ atan (y_over_x.x),
+ atan (y_over_x.y),
+ atan (y_over_x.z)
+ );
+}
+
+vec4 atan (vec4 y_over_x) {
+ return vec4 (
+ atan (y_over_x.x),
+ atan (y_over_x.y),
+ atan (y_over_x.z),
+ atan (y_over_x.w)
+ );
+}
+
+float atan (float y, float x) {
float z = atan (y / x);
- if (x < 0.0)\r
- {\r
- if (y < 0.0)\r
- return z - 3.141593;\r
- return z + 3.141593;\r
- }\r
+ if (x < 0.0)
+ {
+ if (y < 0.0)
+ return z - 3.141593;
+ return z + 3.141593;
+ }
return z;
-}\r
+}
vec2 atan (vec2 u, vec2 v) {
- return vec2 (\r
- atan (u.x, v.x),\r
- atan (u.y, v.y)\r
+ return vec2 (
+ atan (u.x, v.x),
+ atan (u.y, v.y)
);
-}\r
+}
vec3 atan (vec3 u, vec3 v) {
- return vec3 (\r
- atan (u.x, v.x),\r
- atan (u.y, v.y),\r
- atan (u.z, v.z)\r
+ return vec3 (
+ atan (u.x, v.x),
+ atan (u.y, v.y),
+ atan (u.z, v.z)
);
-}\r
+}
vec4 atan (vec4 u, vec4 v) {
- return vec4 (\r
- atan (u.x, v.x),\r
- atan (u.y, v.y),\r
- atan (u.z, v.z),\r
- atan (u.w, v.w)\r
+ return vec4 (
+ atan (u.x, v.x),
+ atan (u.y, v.y),
+ atan (u.z, v.z),
+ atan (u.w, v.w)
);
}
// 8.2 Exponential Functions
//
-float pow (float x, float y) {\r
- float p;\r
+float pow (float x, float y) {
+ float p;
__asm float_power p, x, y;
return p;
-}\r
+}
vec2 pow (vec2 v, vec2 u) {
- return vec2 (\r
- pow (v.x, u.x),\r
- pow (v.y, u.y)\r
+ return vec2 (
+ pow (v.x, u.x),
+ pow (v.y, u.y)
);
-}\r
+}
vec3 pow (vec3 v, vec3 u) {
- return vec3 (\r
- pow (v.x, u.x),\r
- pow (v.y, u.y),\r
- pow (v.z, u.z)\r
+ return vec3 (
+ pow (v.x, u.x),
+ pow (v.y, u.y),
+ pow (v.z, u.z)
);
-}\r
+}
vec4 pow (vec4 v, vec4 u) {
- return vec4 (\r
- pow (v.x, u.x),\r
- pow (v.y, u.y),\r
- pow (v.z, u.z),\r
- pow (v.w, u.w)\r
+ return vec4 (
+ pow (v.x, u.x),
+ pow (v.y, u.y),
+ pow (v.z, u.z),
+ pow (v.w, u.w)
);
}
float exp (float x) {
return pow (2.71828183, x);
-}\r
+}
vec2 exp (vec2 v) {
return pow (vec2 (2.71828183), v);
-}\r
+}
vec3 exp (vec3 v) {
return pow (vec3 (2.71828183), v);
-}\r
+}
vec4 exp (vec4 v) {
return pow (vec4 (2.71828183), v);
}
-float log2 (float x) {\r
- float y;\r
- __asm float_log2 y, x;\r
- return y;\r
-}\r
-\r
-vec2 log2 (vec2 v) {\r
- return vec2 (\r
- log2 (v.x),\r
- log2 (v.y)\r
- );\r
-}\r
-\r
-vec3 log2 (vec3 v) {\r
- return vec3 (\r
- log2 (v.x),\r
- log2 (v.y),\r
- log2 (v.z)\r
- );\r
-}\r
-\r
-vec4 log2 (vec4 v) {\r
- return vec4 (\r
- log2 (v.x),\r
- log2 (v.y),\r
- log2 (v.z),\r
- log2 (v.w)\r
- );\r
-}\r
-\r
+float log2 (float x) {
+ float y;
+ __asm float_log2 y, x;
+ return y;
+}
+
+vec2 log2 (vec2 v) {
+ return vec2 (
+ log2 (v.x),
+ log2 (v.y)
+ );
+}
+
+vec3 log2 (vec3 v) {
+ return vec3 (
+ log2 (v.x),
+ log2 (v.y),
+ log2 (v.z)
+ );
+}
+
+vec4 log2 (vec4 v) {
+ return vec4 (
+ log2 (v.x),
+ log2 (v.y),
+ log2 (v.z),
+ log2 (v.w)
+ );
+}
+
float log (float x) {
return log2 (x) / log2 (2.71828183);
-}\r
+}
vec2 log (vec2 v) {
return log2 (v) / log2 (vec2 (2.71828183));
-}\r
+}
vec3 log (vec3 v) {
return log2 (v) / log2 (vec3 (2.71828183));
-}\r
+}
vec4 log (vec4 v) {
return log2 (v) / log2 (vec4 (2.71828183));
float exp2 (float x) {
return pow (2.0, x);
-}\r
+}
vec2 exp2 (vec2 v) {
return pow (vec2 (2.0), v);
-}\r
+}
vec3 exp2 (vec3 v) {
return pow (vec3 (2.0), v);
-}\r
+}
vec4 exp2 (vec4 v) {
return pow (vec4 (2.0), v);
float sqrt (float x) {
return pow (x, 0.5);
-}\r
+}
vec2 sqrt (vec2 v) {
return pow (v, vec2 (0.5));
-}\r
+}
vec3 sqrt (vec3 v) {
return pow (v, vec3 (0.5));
-}\r
+}
vec4 sqrt (vec4 v) {
return pow (v, vec4 (0.5));
float inversesqrt (float x) {
return 1.0 / sqrt (x);
-}\r
+}
vec2 inversesqrt (vec2 v) {
return vec2 (1.0) / sqrt (v);
-}\r
+}
vec3 inversesqrt (vec3 v) {
return vec3 (1.0) / sqrt (v);
-}\r
+}
vec4 inversesqrt (vec4 v) {
return vec4 (1.0) / sqrt (v);
float abs (float x) {
return x >= 0.0 ? x : -x;
-}\r
+}
-vec2 abs (vec2 v) {\r
- return vec2 (\r
- abs (v.x),\r
- abs (v.y)\r
+vec2 abs (vec2 v) {
+ return vec2 (
+ abs (v.x),
+ abs (v.y)
);
-}\r
+}
vec3 abs (vec3 v) {
- return vec3 (\r
- abs (v.x),\r
- abs (v.y),\r
- abs (v.z)\r
+ return vec3 (
+ abs (v.x),
+ abs (v.y),
+ abs (v.z)
);
-}\r
+}
vec4 abs (vec4 v) {
- return vec4 (\r
- abs (v.x),\r
- abs (v.y),\r
- abs (v.z),\r
- abs (v.w)\r
+ return vec4 (
+ abs (v.x),
+ abs (v.y),
+ abs (v.z),
+ abs (v.w)
);
}
float sign (float x) {
return x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0;
-}\r
+}
vec2 sign (vec2 v) {
- return vec2 (\r
- sign (v.x),\r
- sign (v.y)\r
+ return vec2 (
+ sign (v.x),
+ sign (v.y)
);
-}\r
+}
vec3 sign (vec3 v) {
- return vec3 (\r
- sign (v.x),\r
- sign (v.y),\r
- sign (v.z)\r
+ return vec3 (
+ sign (v.x),
+ sign (v.y),
+ sign (v.z)
);
-}\r
+}
vec4 sign (vec4 v) {
- return vec4 (\r
- sign (v.x),\r
- sign (v.y),\r
- sign (v.z),\r
- sign (v.w)\r
- );
-}
-
-float floor (float x) {\r
- float y;\r
- __asm float_floor y, x;\r
- return y;\r
-}\r
-\r
-vec2 floor (vec2 v) {\r
- return vec2 (\r
- floor (v.x),\r
- floor (v.y)\r
- );\r
-}\r
-\r
-vec3 floor (vec3 v) {\r
- return vec3 (\r
- floor (v.x),\r
- floor (v.y),\r
- floor (v.z)\r
- );\r
-}\r
-\r
-vec4 floor (vec4 v) {\r
- return vec4 (\r
- floor (v.x),\r
- floor (v.y),\r
- floor (v.z),\r
- floor (v.w)\r
- );\r
-}\r
-\r
-float ceil (float x) {\r
- float y;\r
- __asm float_ceil y, x;\r
- return y;\r
-}\r
-\r
-vec2 ceil (vec2 v) {\r
- return vec2 (\r
- ceil (v.x),\r
- ceil (v.y)\r
- );\r
-}\r
-\r
-vec3 ceil (vec3 v) {\r
- return vec3 (\r
- ceil (v.x),\r
- ceil (v.y),\r
- ceil (v.z)\r
- );\r
-}\r
-\r
-vec4 ceil (vec4 v) {\r
- return vec4 (\r
- ceil (v.x),\r
- ceil (v.y),\r
- ceil (v.z),\r
- ceil (v.w)\r
- );\r
-}
-\r
-float fract (float x) {\r
- return x - floor (x);\r
-}\r
-\r
-vec2 fract (vec2 v) {\r
- return v - floor (v);\r
-}\r
-\r
-vec3 fract (vec3 v) {\r
- return v - floor (v);\r
-}\r
-\r
-vec4 fract (vec4 v) {\r
- return v - floor (v);\r
-}\r
+ return vec4 (
+ sign (v.x),
+ sign (v.y),
+ sign (v.z),
+ sign (v.w)
+ );
+}
+
+float floor (float x) {
+ float y;
+ __asm float_floor y, x;
+ return y;
+}
+
+vec2 floor (vec2 v) {
+ return vec2 (
+ floor (v.x),
+ floor (v.y)
+ );
+}
+
+vec3 floor (vec3 v) {
+ return vec3 (
+ floor (v.x),
+ floor (v.y),
+ floor (v.z)
+ );
+}
+
+vec4 floor (vec4 v) {
+ return vec4 (
+ floor (v.x),
+ floor (v.y),
+ floor (v.z),
+ floor (v.w)
+ );
+}
+
+float ceil (float x) {
+ float y;
+ __asm float_ceil y, x;
+ return y;
+}
+
+vec2 ceil (vec2 v) {
+ return vec2 (
+ ceil (v.x),
+ ceil (v.y)
+ );
+}
+
+vec3 ceil (vec3 v) {
+ return vec3 (
+ ceil (v.x),
+ ceil (v.y),
+ ceil (v.z)
+ );
+}
+
+vec4 ceil (vec4 v) {
+ return vec4 (
+ ceil (v.x),
+ ceil (v.y),
+ ceil (v.z),
+ ceil (v.w)
+ );
+}
+
+float fract (float x) {
+ return x - floor (x);
+}
+
+vec2 fract (vec2 v) {
+ return v - floor (v);
+}
+
+vec3 fract (vec3 v) {
+ return v - floor (v);
+}
+
+vec4 fract (vec4 v) {
+ return v - floor (v);
+}
float mod (float x, float y) {
return x - y * floor (x / y);
-}\r
+}
vec2 mod (vec2 v, float u) {
return v - u * floor (v / u);
-}\r
+}
vec3 mod (vec3 v, float u) {
return v - u * floor (v / u);
-}\r
+}
vec4 mod (vec4 v, float u) {
return v - u * floor (v / u);
-}\r
+}
vec2 mod (vec2 v, vec2 u) {
return v - u * floor (v / u);
-}\r
+}
vec3 mod (vec3 v, vec3 u) {
return v - u * floor (v / u);
-}\r
+}
vec4 mod (vec4 v, vec4 u) {
return v - u * floor (v / u);
float min (float x, float y) {
return x < y ? x : y;
-}\r
-
-vec2 min (vec2 v, vec2 u) {\r
- return vec2 (\r
- min (v.x, u.x),\r
- min (v.y, u.y)\r
- );\r
-}\r
-\r
-vec3 min (vec3 v, vec3 u) {\r
- return vec3 (\r
- min (v.x, u.x),\r
- min (v.y, u.y),\r
- min (v.z, u.z)\r
- );\r
-}\r
-\r
-vec4 min (vec4 v, vec4 u) {\r
- return vec4 (\r
- min (v.x, u.x),\r
- min (v.y, u.y),\r
- min (v.z, u.z),\r
- min (v.w, u.w)\r
- );\r
-}\r
-\r
+}
+
+vec2 min (vec2 v, vec2 u) {
+ return vec2 (
+ min (v.x, u.x),
+ min (v.y, u.y)
+ );
+}
+
+vec3 min (vec3 v, vec3 u) {
+ return vec3 (
+ min (v.x, u.x),
+ min (v.y, u.y),
+ min (v.z, u.z)
+ );
+}
+
+vec4 min (vec4 v, vec4 u) {
+ return vec4 (
+ min (v.x, u.x),
+ min (v.y, u.y),
+ min (v.z, u.z),
+ min (v.w, u.w)
+ );
+}
+
vec2 min (vec2 v, float y) {
return min (v, vec2 (y));
-}\r
+}
vec3 min (vec3 v, float y) {
return min (v, vec3 (y));
-}\r
+}
vec4 min (vec4 v, float y) {
return min (v, vec4 (y));
-}\r
+}
float max (float x, float y) {
return x < y ? y : x;
-}\r
-
-vec2 max (vec2 v, vec2 u) {\r
- return vec2 (\r
- max (v.x, u.x),\r
- max (v.y, u.y)\r
- );\r
-}\r
-\r
-vec3 max (vec3 v, vec3 u) {\r
- return vec3 (\r
- max (v.x, u.x),\r
- max (v.y, u.y),\r
- max (v.z, u.z)\r
- );\r
-}\r
-\r
-vec4 max (vec4 v, vec4 u) {\r
- return vec4 (\r
- max (v.x, u.x),\r
- max (v.y, u.y),\r
- max (v.z, u.z),\r
- max (v.w, u.w)\r
- );\r
-}\r
-\r
+}
+
+vec2 max (vec2 v, vec2 u) {
+ return vec2 (
+ max (v.x, u.x),
+ max (v.y, u.y)
+ );
+}
+
+vec3 max (vec3 v, vec3 u) {
+ return vec3 (
+ max (v.x, u.x),
+ max (v.y, u.y),
+ max (v.z, u.z)
+ );
+}
+
+vec4 max (vec4 v, vec4 u) {
+ return vec4 (
+ max (v.x, u.x),
+ max (v.y, u.y),
+ max (v.z, u.z),
+ max (v.w, u.w)
+ );
+}
+
vec2 max (vec2 v, float y) {
return max (v, vec2 (y));
-}\r
+}
vec3 max (vec3 v, float y) {
return max (v, vec3 (y));
-}\r
+}
vec4 max (vec4 v, float y) {
return max (v, vec4 (y));
-}\r
+}
float clamp (float x, float minVal, float maxVal) {
return min (max (x, minVal), maxVal);
-}\r
+}
vec2 clamp (vec2 x, float minVal, float maxVal) {
return min (max (x, minVal), maxVal);
-}\r
+}
vec3 clamp (vec3 x, float minVal, float maxVal) {
return min (max (x, minVal), maxVal);
-}\r
+}
vec4 clamp (vec4 x, float minVal, float maxVal) {
return min (max (x, minVal), maxVal);
-}\r
+}
vec2 clamp (vec2 x, vec2 minVal, vec2 maxVal) {
return min (max (x, minVal), maxVal);
-}\r
+}
vec3 clamp (vec3 x, vec3 minVal, vec3 maxVal) {
return min (max (x, minVal), maxVal);
-}\r
+}
vec4 clamp (vec4 x, vec4 minVal, vec4 maxVal) {
return min (max (x, minVal), maxVal);
float mix (float x, float y, float a) {
return x * (1.0 - a) + y * a;
-}\r
+}
vec2 mix (vec2 x, vec2 y, float a) {
return x * (1.0 - a) + y * a;
-}\r
+}
vec3 mix (vec3 x, vec3 y, float a) {
return x * (1.0 - a) + y * a;
-}\r
+}
vec4 mix (vec4 x, vec4 y, float a) {
return x * (1.0 - a) + y * a;
-}\r
+}
vec2 mix (vec2 x, vec2 y, vec2 a) {
return x * (1.0 - a) + y * a;
-}\r
+}
vec3 mix (vec3 x, vec3 y, vec3 a) {
return x * (1.0 - a) + y * a;
-}\r
+}
vec4 mix (vec4 x, vec4 y, vec4 a) {
return x * (1.0 - a) + y * a;
float step (float edge, float x) {
return x < edge ? 0.0 : 1.0;
-}\r
-
-vec2 step (vec2 edge, vec2 v) {\r
- return vec2 (\r
- step (edge.x, v.x),\r
- step (edge.y, v.y)\r
- );\r
-}\r
-\r
-vec3 step (vec3 edge, vec3 v) {\r
- return vec3 (\r
- step (edge.x, v.x),\r
- step (edge.y, v.y),\r
- step (edge.z, v.z)\r
- );\r
-}\r
-\r
-vec4 step (vec4 edge, vec4 v) {\r
- return vec4 (\r
- step (edge.x, v.x),\r
- step (edge.y, v.y),\r
- step (edge.z, v.z),\r
- step (edge.w, v.w)\r
- );\r
-}\r
-\r
+}
+
+vec2 step (vec2 edge, vec2 v) {
+ return vec2 (
+ step (edge.x, v.x),
+ step (edge.y, v.y)
+ );
+}
+
+vec3 step (vec3 edge, vec3 v) {
+ return vec3 (
+ step (edge.x, v.x),
+ step (edge.y, v.y),
+ step (edge.z, v.z)
+ );
+}
+
+vec4 step (vec4 edge, vec4 v) {
+ return vec4 (
+ step (edge.x, v.x),
+ step (edge.y, v.y),
+ step (edge.z, v.z),
+ step (edge.w, v.w)
+ );
+}
+
vec2 step (float edge, vec2 v) {
return step (vec2 (edge), v);
}
-\r
+
vec3 step (float edge, vec3 v) {
return step (vec3 (edge), v);
-}\r
+}
vec4 step (float edge, vec4 v) {
return step (vec4 (edge), v);
-}\r
+}
float smoothstep (float edge0, float edge1, float x) {
float t = clamp ((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t);
-}\r
-
-vec2 smoothstep (vec2 edge0, vec2 edge1, vec2 v) {\r
- return vec2 (\r
- smoothstep (edge0.x, edge1.x, v.x),\r
- smoothstep (edge0.y, edge1.y, v.y)\r
- );\r
-}\r
-\r
-vec3 smoothstep (vec3 edge0, vec3 edge1, vec3 v) {\r
- return vec3 (\r
- smoothstep (edge0.x, edge1.x, v.x),\r
- smoothstep (edge0.y, edge1.y, v.y),\r
- smoothstep (edge0.z, edge1.z, v.z)\r
- );\r
-}\r
-\r
-vec4 smoothstep (vec4 edge0, vec4 edge1, vec4 v) {\r
- return vec4 (\r
- smoothstep (edge0.x, edge1.x, v.x),\r
- smoothstep (edge0.y, edge1.y, v.y),\r
- smoothstep (edge0.z, edge1.z, v.z),\r
- smoothstep (edge0.w, edge1.w, v.w)\r
- );\r
-}\r
-\r
+}
+
+vec2 smoothstep (vec2 edge0, vec2 edge1, vec2 v) {
+ return vec2 (
+ smoothstep (edge0.x, edge1.x, v.x),
+ smoothstep (edge0.y, edge1.y, v.y)
+ );
+}
+
+vec3 smoothstep (vec3 edge0, vec3 edge1, vec3 v) {
+ return vec3 (
+ smoothstep (edge0.x, edge1.x, v.x),
+ smoothstep (edge0.y, edge1.y, v.y),
+ smoothstep (edge0.z, edge1.z, v.z)
+ );
+}
+
+vec4 smoothstep (vec4 edge0, vec4 edge1, vec4 v) {
+ return vec4 (
+ smoothstep (edge0.x, edge1.x, v.x),
+ smoothstep (edge0.y, edge1.y, v.y),
+ smoothstep (edge0.z, edge1.z, v.z),
+ smoothstep (edge0.w, edge1.w, v.w)
+ );
+}
+
vec2 smoothstep (float edge0, float edge1, vec2 v) {
- return vec2 (\r
- smoothstep (edge0, edge1, v.x),\r
- smoothstep (edge0, edge1, v.y)\r
- );\r
-}\r
+ return vec2 (
+ smoothstep (edge0, edge1, v.x),
+ smoothstep (edge0, edge1, v.y)
+ );
+}
vec3 smoothstep (float edge0, float edge1, vec3 v) {
- return vec3 (\r
- smoothstep (edge0, edge1, v.x),\r
- smoothstep (edge0, edge1, v.y),\r
- smoothstep (edge0, edge1, v.z)\r
- );\r
-}\r
+ return vec3 (
+ smoothstep (edge0, edge1, v.x),
+ smoothstep (edge0, edge1, v.y),
+ smoothstep (edge0, edge1, v.z)
+ );
+}
vec4 smoothstep (float edge0, float edge1, vec4 v) {
- return vec4 (\r
- smoothstep (edge0, edge1, v.x),\r
- smoothstep (edge0, edge1, v.y),\r
- smoothstep (edge0, edge1, v.z),\r
- smoothstep (edge0, edge1, v.w)\r
- );\r
-}\r
+ return vec4 (
+ smoothstep (edge0, edge1, v.x),
+ smoothstep (edge0, edge1, v.y),
+ smoothstep (edge0, edge1, v.z),
+ smoothstep (edge0, edge1, v.w)
+ );
+}
//
// 8.4 Geometric Functions
float dot (float x, float y) {
return x * y;
-}\r
+}
float dot (vec2 v, vec2 u) {
return v.x * u.x + v.y * u.y;
-}\r
+}
float dot (vec3 v, vec3 u) {
return v.x * u.x + v.y * u.y + v.z * u.z;
-}\r
+}
float dot (vec4 v, vec4 u) {
return v.x * u.x + v.y * u.y + v.z * u.z + v.w * u.w;
float length (float x) {
return sqrt (dot (x, x));
-}\r
+}
float length (vec2 v) {
return sqrt (dot (v, v));
-}\r
+}
float length (vec3 v) {
return sqrt (dot (v, v));
-}\r
+}
float length (vec4 v) {
return sqrt (dot (v, v));
float distance (float x, float y) {
return length (x - y);
-}\r
+}
float distance (vec2 v, vec2 u) {
return length (v - u);
-}\r
+}
float distance (vec3 v, vec3 u) {
return length (v - u);
-}\r
+}
float distance (vec4 v, vec4 u) {
return length (v - u);
}
vec3 cross (vec3 v, vec3 u) {
- return vec3 (\r
- v.y * u.z - u.y * v.z,\r
- v.z * u.x - u.z * v.x,\r
- v.x * u.y - u.x * v.y\r
- );\r
+ return vec3 (
+ v.y * u.z - u.y * v.z,
+ v.z * u.x - u.z * v.x,
+ v.x * u.y - u.x * v.y
+ );
}
float normalize (float x) {
return 1.0;
-}\r
+}
vec2 normalize (vec2 v) {
return v / length (v);
-}\r
+}
vec3 normalize (vec3 v) {
return v / length (v);
-}\r
+}
vec4 normalize (vec4 v) {
return v / length (v);
float faceforward (float N, float I, float Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
-}\r
+}
vec2 faceforward (vec2 N, vec2 I, vec2 Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
-}\r
+}
vec3 faceforward (vec3 N, vec3 I, vec3 Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
-}\r
+}
vec4 faceforward (vec4 N, vec4 I, vec4 Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
float reflect (float I, float N) {
return I - 2.0 * dot (N, I) * N;
-}\r
+}
vec2 reflect (vec2 I, vec2 N) {
return I - 2.0 * dot (N, I) * N;
-}\r
+}
vec3 reflect (vec3 I, vec3 N) {
return I - 2.0 * dot (N, I) * N;
-}\r
+}
vec4 reflect (vec4 I, vec4 N) {
return I - 2.0 * dot (N, I) * N;
if (k < 0.0)
return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}\r
+}
vec2 refract (vec2 I, vec2 N, float eta) {
- float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));\r
- if (k < 0.0)\r
- return 0.0;\r
+ float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
+ if (k < 0.0)
+ return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}\r
+}
vec3 refract (vec3 I, vec3 N, float eta) {
- float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));\r
- if (k < 0.0)\r
- return 0.0;\r
+ float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
+ if (k < 0.0)
+ return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}\r
+}
vec4 refract (vec4 I, vec4 N, float eta) {
- float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));\r
- if (k < 0.0)\r
- return 0.0;\r
+ float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
+ if (k < 0.0)
+ return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
}
mat2 matrixCompMult (mat2 m, mat2 n) {
return mat2 (m[0] * n[0], m[1] * n[1]);
-}\r
+}
mat3 matrixCompMult (mat3 m, mat3 n) {
return mat3 (m[0] * n[0], m[1] * n[1], m[2] * n[2]);
-}\r
+}
mat4 matrixCompMult (mat4 m, mat4 n) {
return mat4 (m[0] * n[0], m[1] * n[1], m[2] * n[2], m[3] * n[3]);
// 8.6 Vector Relational Functions
//
-bvec2 lessThan (vec2 v, vec2 u) {\r
+bvec2 lessThan (vec2 v, vec2 u) {
return bvec2 (v.x < u.x, v.y < u.y);
-}\r
+}
bvec3 lessThan (vec3 v, vec3 u) {
return bvec3 (v.x < u.x, v.y < u.y, v.z < u.z);
-}\r
+}
bvec4 lessThan (vec4 v, vec4 u) {
return bvec4 (v.x < u.x, v.y < u.y, v.z < u.z, v.w < u.w);
-}\r
+}
bvec2 lessThan (ivec2 v, ivec2 u) {
return bvec2 (v.x < u.x, v.y < u.y);
-}\r
+}
bvec3 lessThan (ivec3 v, ivec3 u) {
return bvec3 (v.x < u.x, v.y < u.y, v.z < u.z);
-}\r
+}
bvec4 lessThan (ivec4 v, ivec4 u) {
return bvec4 (v.x < u.x, v.y < u.y, v.z < u.z, v.w < u.w);
bvec2 lessThanEqual (vec2 v, vec2 u) {
return bvec2 (v.x <= u.x, v.y <= u.y);
-}\r
+}
bvec3 lessThanEqual (vec3 v, vec3 u) {
return bvec3 (v.x <= u.x, v.y <= u.y, v.z <= u.z);
-}\r
+}
bvec4 lessThanEqual (vec4 v, vec4 u) {
return bvec4 (v.x <= u.x, v.y <= u.y, v.z <= u.z, v.w <= u.w);
-}\r
+}
bvec2 lessThanEqual (ivec2 v, ivec2 u) {
return bvec2 (v.x <= u.x, v.y <= u.y);
-}\r
+}
bvec3 lessThanEqual (ivec3 v, ivec3 u) {
return bvec3 (v.x <= u.x, v.y <= u.y, v.z <= u.z);
-}\r
+}
bvec4 lessThanEqual (ivec4 v, ivec4 u) {
return bvec4 (v.x <= u.x, v.y <= u.y, v.z <= u.z, v.w <= u.w);
bvec2 greaterThan (vec2 v, vec2 u) {
return bvec2 (v.x > u.x, v.y > u.y);
-}\r
+}
bvec3 greaterThan (vec3 v, vec3 u) {
return bvec3 (v.x > u.x, v.y > u.y, v.z > u.z);
-}\r
+}
bvec4 greaterThan (vec4 v, vec4 u) {
return bvec4 (v.x > u.x, v.y > u.y, v.z > u.z, v.w > u.w);
-}\r
+}
bvec2 greaterThan (ivec2 v, ivec2 u) {
return bvec2 (v.x > u.x, v.y > u.y);
-}\r
+}
bvec3 greaterThan (ivec3 v, ivec3 u) {
return bvec3 (v.x > u.x, v.y > u.y, v.z > u.z);
-}\r
+}
bvec4 greaterThan (ivec4 v, ivec4 u) {
return bvec4 (v.x > u.x, v.y > u.y, v.z > u.z, v.w > u.w);
bvec2 greaterThanEqual (vec2 v, vec2 u) {
return bvec2 (v.x >= u.x, v.y >= u.y);
-}\r
+}
bvec3 greaterThanEqual (vec3 v, vec3 u) {
return bvec3 (v.x >= u.x, v.y >= u.y, v.z >= u.z);
-}\r
+}
bvec4 greaterThanEqual (vec4 v, vec4 u) {
return bvec4 (v.x >= u.x, v.y >= u.y, v.z >= u.z, v.w >= u.w);
-}\r
+}
bvec2 greaterThanEqual (ivec2 v, ivec2 u) {
return bvec2 (v.x >= u.x, v.y >= u.y);
-}\r
+}
bvec3 greaterThanEqual (ivec3 v, ivec3 u) {
return bvec3 (v.x >= u.x, v.y >= u.y, v.z >= u.z);
-}\r
+}
bvec4 greaterThanEqual (ivec4 v, ivec4 u) {
return bvec4 (v.x >= u.x, v.y >= u.y, v.z >= u.z, v.w >= u.w);
bvec2 equal (vec2 v, vec2 u) {
return bvec2 (v.x == u.x, v.y == u.y);
-}\r
+}
bvec3 equal (vec3 v, vec3 u) {
return bvec3 (v.x == u.x, v.y == u.y, v.z == u.z);
-}\r
+}
bvec4 equal (vec4 v, vec4 u) {
return bvec4 (v.x == u.x, v.y == u.y, v.z == u.z, v.w == u.w);
-}\r
+}
bvec2 equal (ivec2 v, ivec2 u) {
return bvec2 (v.x == u.x, v.y == u.y);
-}\r
+}
bvec3 equal (ivec3 v, ivec3 u) {
return bvec3 (v.x == u.x, v.y == u.y, v.z == u.z);
-}\r
+}
bvec4 equal (ivec4 v, ivec4 u) {
return bvec4 (v.x == u.x, v.y == u.y, v.z == u.z, v.w == u.w);
bvec2 notEqual (vec2 v, vec2 u) {
return bvec2 (v.x != u.x, v.y != u.y);
-}\r
+}
bvec3 notEqual (vec3 v, vec3 u) {
return bvec3 (v.x != u.x, v.y != u.y, v.z != u.z);
-}\r
+}
bvec4 notEqual (vec4 v, vec4 u) {
return bvec4 (v.x != u.x, v.y != u.y, v.z != u.z, v.w != u.w);
-}\r
+}
bvec2 notEqual (ivec2 v, ivec2 u) {
return bvec2 (v.x != u.x, v.y != u.y);
-}\r
+}
bvec3 notEqual (ivec3 v, ivec3 u) {
return bvec3 (v.x != u.x, v.y != u.y, v.z != u.z);
-}\r
+}
bvec4 notEqual (ivec4 v, ivec4 u) {
- return bvec4 (v.x != u.x, v.y != u.y, v.z != u.z, v.w != u.w);\r
+ return bvec4 (v.x != u.x, v.y != u.y, v.z != u.z, v.w != u.w);
}
bool any (bvec2 v) {
return v.x || v.y;
-}\r
+}
bool any (bvec3 v) {
return v.x || v.y || v.z;
-}\r
+}
bool any (bvec4 v) {
return v.x || v.y || v.z || v.w;
bool all (bvec2 v) {
return v.x && v.y;
-}\r
+}
bool all (bvec3 v) {
return v.x && v.y && v.z;
-}\r
+}
bool all (bvec4 v) {
return v.x && v.y && v.z && v.w;
}
-bvec2 not (bvec2 v) {\r
- return bvec2 (!v.x, !v.y);\r
-}\r
+bvec2 not (bvec2 v) {
+ return bvec2 (!v.x, !v.y);
+}
bvec3 not (bvec3 v) {
return bvec3 (!v.x, !v.y, !v.z);
-}\r
+}
bvec4 not (bvec4 v) {
- return bvec4 (!v.x, !v.y, !v.z, !v.w);\r
+ return bvec4 (!v.x, !v.y, !v.z, !v.w);
}
//
// 8.7 Texture Lookup Functions
//
-vec4 texture1D (sampler1D sampler, float coord) {\r
- vec4 texel;\r
- __asm vec4_tex1d texel, sampler, coord, 0.0;\r
+vec4 texture1D (sampler1D sampler, float coord) {
+ vec4 texel;
+ __asm vec4_tex1d texel, sampler, coord, 0.0;
return texel;
-}\r
+}
vec4 texture1DProj (sampler1D sampler, vec2 coord) {
return texture1D (sampler, coord.s / coord.t);
-}\r
+}
vec4 texture1DProj (sampler1D sampler, vec4 coord) {
return texture1D (sampler, coord.s / coord.q);
}
-vec4 texture2D (sampler2D sampler, vec2 coord) {\r
- vec4 texel;\r
- __asm vec4_tex2d texel, sampler, coord, 0.0;\r
+vec4 texture2D (sampler2D sampler, vec2 coord) {
+ vec4 texel;
+ __asm vec4_tex2d texel, sampler, coord, 0.0;
return texel;
-}\r
+}
-vec4 texture2DProj (sampler2D sampler, vec3 coord) {\r
+vec4 texture2DProj (sampler2D sampler, vec3 coord) {
return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p));
-}\r
+}
-vec4 texture2DProj (sampler2D sampler, vec4 coord) {\r
+vec4 texture2DProj (sampler2D sampler, vec4 coord) {
return texture2D (sampler, vec2 (coord.s / coord.q, coord.t / coord.q));
}
-vec4 texture3D (sampler3D sampler, vec3 coord) {\r
- vec4 texel;\r
- __asm vec4_tex3d texel, sampler, coord, 0.0;\r
+vec4 texture3D (sampler3D sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_tex3d texel, sampler, coord, 0.0;
return texel;
-}\r
+}
-vec4 texture3DProj (sampler3D sampler, vec4 coord) {\r
+vec4 texture3DProj (sampler3D sampler, vec4 coord) {
return texture3D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));
}
-vec4 textureCube (samplerCube sampler, vec3 coord) {\r
- vec4 texel;\r
- __asm vec4_texcube texel, sampler, coord, 0.0;\r
+vec4 textureCube (samplerCube sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_texcube texel, sampler, coord, 0.0;
return texel;
}
-vec4 shadow1D (sampler1DShadow sampler, vec3 coord) {\r
- vec4 texel;\r
- __asm vec4_shad1d texel, sampler, coord, 0.0;\r
+vec4 shadow1D (sampler1DShadow sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_shad1d texel, sampler, coord, 0.0;
return texel;
}
-vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) {\r
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));\r
-}\r
-\r
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {\r
- vec4 texel;\r
- __asm vec4_shad2d texel, sampler, coord, 0.0;\r
+vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) {
+ return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));
+}
+
+vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_shad2d texel, sampler, coord, 0.0;
return texel;
-}\r
+}
-vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) {\r
+vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) {
return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));
}
//
-// 8.9 Noise Functions\r
-//\r
+// 8.9 Noise Functions
+//
// AUTHOR: Stefan Gustavson (stegu@itn.liu.se), Nov 26, 2005
//
-float noise1 (float x) {\r
- float a;\r
- __asm float_noise1 a, x;\r
+float noise1 (float x) {
+ float a;
+ __asm float_noise1 a, x;
return a;
}
-float noise1 (vec2 x) {\r
- float a;\r
- __asm float_noise2 a, x;\r
+float noise1 (vec2 x) {
+ float a;
+ __asm float_noise2 a, x;
return a;
}
-float noise1 (vec3 x) {\r
- float a;\r
- __asm float_noise3 a, x;\r
+float noise1 (vec3 x) {
+ float a;
+ __asm float_noise3 a, x;
return a;
}
-float noise1 (vec4 x) {\r
- float a;\r
- __asm float_noise4 a, x;\r
+float noise1 (vec4 x) {
+ float a;
+ __asm float_noise4 a, x;
return a;
}
-vec2 noise2 (float x) {\r
- return vec2 (\r
- noise1 (x),\r
- noise1 (x + 19.34)\r
+vec2 noise2 (float x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + 19.34)
);
}
-vec2 noise2 (vec2 x) {\r
- return vec2 (\r
- noise1 (x),\r
- noise1 (x + vec2 (19.34, 7.66))\r
+vec2 noise2 (vec2 x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + vec2 (19.34, 7.66))
);
}
-vec2 noise2 (vec3 x) {\r
- return vec2 (\r
- noise1 (x),\r
- noise1 (x + vec3 (19.34, 7.66, 3.23))\r
+vec2 noise2 (vec3 x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + vec3 (19.34, 7.66, 3.23))
);
}
-vec2 noise2 (vec4 x) {\r
- return vec2 (\r
- noise1 (x),\r
- noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77))\r
+vec2 noise2 (vec4 x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77))
);
}
-vec3 noise3 (float x) {\r
- return vec3 (\r
- noise1 (x),\r
- noise1 (x + 19.34),\r
- noise1 (x + 5.47)\r
- );\r
+vec3 noise3 (float x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + 19.34),
+ noise1 (x + 5.47)
+ );
}
-vec3 noise3 (vec2 x) {\r
- return vec3 (\r
- noise1 (x),\r
- noise1 (x + vec2 (19.34, 7.66)),\r
- noise1 (x + vec2 (5.47, 17.85))\r
- );\r
+vec3 noise3 (vec2 x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + vec2 (19.34, 7.66)),
+ noise1 (x + vec2 (5.47, 17.85))
+ );
}
-vec3 noise3 (vec3 x) {\r
- return vec3 (\r
- noise1 (x),\r
- noise1 (x + vec3 (19.34, 7.66, 3.23)),\r
- noise1 (x + vec3 (5.47, 17.85, 11.04))\r
+vec3 noise3 (vec3 x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + vec3 (19.34, 7.66, 3.23)),
+ noise1 (x + vec3 (5.47, 17.85, 11.04))
);
}
-vec3 noise3 (vec4 x) {\r
- return vec3 (\r
- noise1 (x),\r
- noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77)),\r
- noise1 (x + vec4 (5.47, 17.85, 11.04, 13.19))\r
+vec3 noise3 (vec4 x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77)),
+ noise1 (x + vec4 (5.47, 17.85, 11.04, 13.19))
);
}
-vec4 noise4 (float x) {\r
- return vec4 (\r
- noise1 (x),\r
- noise1 (x + 19.34),\r
- noise1 (x + 5.47),\r
- noise1 (x + 23.54)\r
- );\r
+vec4 noise4 (float x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + 19.34),
+ noise1 (x + 5.47),
+ noise1 (x + 23.54)
+ );
}
-vec4 noise4 (vec2 x) {\r
- return vec4 (\r
- noise1 (x),\r
- noise1 (x + vec2 (19.34, 7.66)),\r
- noise1 (x + vec2 (5.47, 17.85)),\r
- noise1 (x + vec2 (23.54, 29.11))\r
- );\r
+vec4 noise4 (vec2 x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + vec2 (19.34, 7.66)),
+ noise1 (x + vec2 (5.47, 17.85)),
+ noise1 (x + vec2 (23.54, 29.11))
+ );
}
-vec4 noise4 (vec3 x) {\r
- return vec4 (\r
- noise1 (x),\r
- noise1 (x + vec3 (19.34, 7.66, 3.23)),\r
- noise1 (x + vec3 (5.47, 17.85, 11.04)),\r
- noise1 (x + vec3 (23.54, 29.11, 31.91))\r
- );\r
+vec4 noise4 (vec3 x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + vec3 (19.34, 7.66, 3.23)),
+ noise1 (x + vec3 (5.47, 17.85, 11.04)),
+ noise1 (x + vec3 (23.54, 29.11, 31.91))
+ );
}
-vec4 noise4 (vec4 x) {\r
- return vec4 (\r
- noise1 (x),\r
- noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77)),\r
- noise1 (x + vec4 (5.47, 17.85, 11.04, 13.19)),\r
- noise1 (x + vec4 (23.54, 29.11, 31.91, 37.48))\r
- );\r
+vec4 noise4 (vec4 x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77)),
+ noise1 (x + vec4 (5.47, 17.85, 11.04, 13.19)),
+ noise1 (x + vec4 (23.54, 29.11, 31.91, 37.48))
+ );
}
-\r
+
-\r
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\r
-/* slang_common_builtin.gc */\r
-\r
-3,2,2,1,5,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,\r
-97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,\r
-101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,\r
-101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120,\r
-86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,10,49,54,0,0,0,2,2,1,5,1,103,108,95,77,97,\r
-120,86,101,114,116,101,120,85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,\r
-16,10,53,49,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,\r
-115,0,2,16,10,51,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,\r
-114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,1,5,1,103,108,95,77,97,120,67,\r
-111,109,98,105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,\r
-10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,\r
-116,115,0,2,16,10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116,85,110,105,\r
-102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,1,5,1,103,108,95,\r
-77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,4,15,1,103,108,95,77,111,\r
-100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,\r
-116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,\r
-119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,84,101,\r
-120,116,117,114,101,77,97,116,114,105,120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,\r
-67,111,111,114,100,115,0,0,0,2,2,4,14,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,\r
-0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,\r
-115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,\r
-110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,\r
-106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,\r
-108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0,3,18,103,108,\r
-95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,\r
-100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,\r
-1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,\r
-115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,\r
-105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,\r
-101,120,116,117,114,101,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,\r
-77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,100,\r
-101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,\r
-115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,\r
-110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,\r
-101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,\r
-114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,101,120,116,117,114,\r
-101,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,\r
-108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,9,1,103,108,95,78,\r
-111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,0,22,103,108,95,68,101,112,116,104,82,97,110,103,101,\r
-80,97,114,97,109,101,116,101,114,115,0,9,110,101,97,114,0,0,0,1,9,102,97,114,0,0,0,1,9,100,105,102,\r
-102,0,0,0,0,0,0,2,2,4,23,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114,97,109,101,116,\r
-101,114,115,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,4,12,1,103,108,95,67,108,\r
-105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,0,0,2,\r
-2,0,22,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,9,115,105,122,101,0,0,\r
-0,1,9,115,105,122,101,77,105,110,0,0,0,1,9,115,105,122,101,77,97,120,0,0,0,1,9,102,97,100,101,84,\r
-104,114,101,115,104,111,108,100,83,105,122,101,0,0,0,1,9,100,105,115,116,97,110,99,101,67,111,110,\r
-115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,110,99,\r
-101,76,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,\r
-110,99,101,81,117,97,100,114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,2,\r
-2,4,23,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,80,111,\r
-105,110,116,0,0,0,2,2,0,22,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,\r
-114,115,0,12,101,109,105,115,115,105,111,110,0,0,0,1,12,97,109,98,105,101,110,116,0,0,0,1,12,100,\r
-105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,9,115,104,105,110,105,110,\r
-101,115,115,0,0,0,0,0,0,2,2,4,23,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,\r
-101,114,115,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,4,23,103,108,\r
-95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,66,97,99,107,\r
-77,97,116,101,114,105,97,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,\r
-97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,100,105,102,102,117,\r
-115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,12,112,111,115,105,116,105,111,110,0,0,0,\r
-1,12,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,115,112,111,116,68,105,114,101,99,116,105,111,\r
-110,0,0,0,1,9,115,112,111,116,69,120,112,111,110,101,110,116,0,0,0,1,9,115,112,111,116,67,117,116,\r
-111,102,102,0,0,0,1,9,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0,0,1,9,99,111,110,115,\r
-116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,108,105,110,101,97,114,65,116,\r
-116,101,110,117,97,116,105,111,110,0,0,0,1,9,113,117,97,100,114,97,116,105,99,65,116,116,101,110,\r
-117,97,116,105,111,110,0,0,0,0,0,0,2,2,4,23,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,\r
-97,114,97,109,101,116,101,114,115,0,1,103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,\r
-103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,\r
-100,101,108,80,97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,0,0,0,2,2,4,\r
-23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,1,103,\r
-108,95,76,105,103,104,116,77,111,100,101,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,\r
-100,101,108,80,114,111,100,117,99,116,115,0,12,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,2,\r
-2,4,23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,\r
-95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,4,\r
-23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,95,\r
-66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,0,22,103,\r
-108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,\r
-100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,0,0,0,2,2,4,23,103,108,\r
-95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,70,114,111,110,116,76,105,103,\r
-104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,4,\r
-23,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,66,97,99,107,76,105,\r
-103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,\r
-4,12,1,103,108,95,84,101,120,116,117,114,101,69,110,118,67,111,108,111,114,0,3,18,103,108,95,77,97,\r
-120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,0,0,2,2,4,12,1,103,108,95,69,\r
-121,101,80,108,97,110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,\r
-100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,\r
-101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,\r
-110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,\r
-4,12,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,\r
-114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,\r
-83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,\r
-103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,\r
-117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,\r
-101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,\r
-12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,\r
-116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,0,22,103,108,95,70,111,103,80,97,114,97,109,101,\r
-116,101,114,115,0,12,99,111,108,111,114,0,0,0,1,9,100,101,110,115,105,116,121,0,0,0,1,9,115,116,97,\r
-114,116,0,0,0,1,9,101,110,100,0,0,0,1,9,115,99,97,108,101,0,0,0,0,0,0,2,2,4,23,103,108,95,70,111,\r
-103,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,70,111,103,0,0,0,1,0,9,0,114,97,100,105,97,\r
-110,115,0,1,0,0,9,100,101,103,0,0,0,1,8,17,51,0,49,52,49,53,57,51,0,0,18,100,101,103,0,48,17,49,56,\r
-48,0,48,0,0,49,0,0,1,0,10,0,114,97,100,105,97,110,115,0,1,0,0,10,100,101,103,0,0,0,1,8,58,118,101,\r
-99,50,0,17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,50,0,17,49,56,48,0,48,\r
-0,0,0,0,49,0,0,1,0,11,0,114,97,100,105,97,110,115,0,1,0,0,11,100,101,103,0,0,0,1,8,58,118,101,99,\r
-51,0,17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,51,0,17,49,56,48,0,48,0,0,\r
-0,0,49,0,0,1,0,12,0,114,97,100,105,97,110,115,0,1,0,0,12,100,101,103,0,0,0,1,8,58,118,101,99,52,0,\r
-17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,52,0,17,49,56,48,0,48,0,0,0,0,\r
-49,0,0,1,0,9,0,100,101,103,114,101,101,115,0,1,0,0,9,114,97,100,0,0,0,1,8,17,49,56,48,0,48,0,0,18,\r
-114,97,100,0,48,17,51,0,49,52,49,53,57,51,0,0,49,0,0,1,0,10,0,100,101,103,114,101,101,115,0,1,0,0,\r
-10,114,97,100,0,0,0,1,8,58,118,101,99,50,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,\r
-99,50,0,17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,11,0,100,101,103,114,101,101,115,0,1,0,0,11,\r
-114,97,100,0,0,0,1,8,58,118,101,99,51,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,99,\r
-51,0,17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,12,0,100,101,103,114,101,101,115,0,1,0,0,12,114,\r
-97,100,0,0,0,1,8,58,118,101,99,52,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,99,52,0,\r
-17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,9,0,115,105,110,0,1,0,0,9,97,110,103,108,101,0,0,0,1,\r
-3,2,0,9,1,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,120,0,0,18,97,110,103,108,101,0,0,\r
-0,8,18,120,0,0,0,1,0,10,0,115,105,110,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,101,99,50,0,\r
-58,115,105,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,\r
-59,121,0,0,0,0,0,0,0,1,0,11,0,115,105,110,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,101,99,51,\r
-0,58,115,105,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,\r
-59,121,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,110,\r
-0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,115,105,110,0,18,97,110,103,108,101,\r
-0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,115,105,110,0,18,97,\r
-110,103,108,101,0,59,122,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,0,\r
-9,0,99,111,115,0,1,0,0,9,97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,17,\r
-49,0,53,55,48,56,0,0,46,0,0,0,0,1,0,10,0,99,111,115,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,\r
-101,99,50,0,58,99,111,115,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,\r
-108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,99,111,115,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,\r
-101,99,51,0,58,99,111,115,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,\r
-108,101,0,59,121,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,\r
-111,115,0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,99,111,115,0,18,97,110,103,\r
-108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,99,111,115,0,18,\r
-97,110,103,108,101,0,59,122,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,\r
-0,9,0,116,97,110,0,1,0,0,9,97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,0,\r
-0,58,99,111,115,0,18,97,110,103,108,101,0,0,0,49,0,0,1,0,10,0,116,97,110,0,1,0,0,10,97,110,103,108,\r
-101,0,0,0,1,8,58,118,101,99,50,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,\r
-110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,116,97,110,0,1,0,0,11,97,110,103,108,\r
-101,0,0,0,1,8,58,118,101,99,51,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,\r
-110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,122,0,0,0,\r
-0,0,0,0,1,0,12,0,116,97,110,0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,116,97,\r
-110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,121,0,0,0,\r
-0,58,116,97,110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,\r
-59,119,0,0,0,0,0,0,0,1,0,9,0,97,115,105,110,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,\r
-111,97,116,95,97,114,99,115,105,110,101,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,97,115,\r
-105,110,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,\r
-97,115,105,110,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,115,105,110,0,1,0,0,11,118,0,0,0,1,8,58,\r
-118,101,99,51,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97,115,105,110,0,18,118,0,59,121,0,\r
-0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,115,105,110,0,1,0,0,12,118,0,0,\r
-0,1,8,58,118,101,99,52,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97,115,105,110,0,18,118,0,\r
-59,121,0,0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,58,97,115,105,110,0,18,118,0,59,119,0,0,\r
-0,0,0,0,0,1,0,9,0,97,99,111,115,0,1,0,0,9,120,0,0,0,1,8,17,49,0,53,55,48,56,0,0,58,97,115,105,110,\r
-0,18,120,0,0,0,47,0,0,1,0,10,0,97,99,111,115,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,97,99,\r
-111,115,0,18,118,0,59,120,0,0,0,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,99,\r
-111,115,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,0,58,\r
-97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,\r
-97,99,111,115,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,\r
-0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,0,58,97,99,\r
-111,115,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,116,97,110,0,1,0,0,9,121,95,111,118,101,114,95,\r
-120,0,0,0,1,3,2,0,9,1,122,0,0,0,4,102,108,111,97,116,95,97,114,99,116,97,110,0,18,122,0,0,18,121,\r
-95,111,118,101,114,95,120,0,0,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,121,95,111,118,\r
-101,114,95,120,0,0,0,1,8,58,118,101,99,50,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,\r
-59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,\r
-97,116,97,110,0,1,0,0,11,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,51,0,58,97,116,97,\r
-110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,\r
-114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,0,0,\r
-0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,52,0,\r
-58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,\r
-111,118,101,114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,\r
-122,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,\r
-116,97,110,0,1,0,0,9,121,0,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,122,0,2,58,97,116,97,110,0,18,121,0,18,\r
-120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,48,0,48,0,0,40,0,8,18,122,0,17,\r
-51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,46,0,0,9,14,0,8,18,\r
-122,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,117,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,\r
-97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,18,117,0,59,121,0,0,\r
-18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,116,97,110,0,1,0,0,11,117,0,0,1,0,0,11,118,0,0,0,1,8,58,\r
-118,101,99,51,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,\r
-18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,\r
-0,0,0,0,0,0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,117,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,\r
-58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,18,117,0,59,121,\r
-0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,0,58,97,\r
-116,97,110,0,18,117,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,112,111,119,0,1,0,0,9,120,0,\r
-0,1,0,0,9,121,0,0,0,1,3,2,0,9,1,112,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,112,0,0,\r
-18,120,0,0,18,121,0,0,0,8,18,112,0,0,0,1,0,10,0,112,111,119,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,\r
-1,8,58,118,101,99,50,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,112,111,119,\r
-0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,0,0,0,1,0,11,0,112,111,119,0,1,0,0,11,118,0,0,1,0,0,\r
-11,117,0,0,0,1,8,58,118,101,99,51,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,\r
-58,112,111,119,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,112,111,119,0,18,118,0,59,122,0,0,\r
-18,117,0,59,122,0,0,0,0,0,0,0,1,0,12,0,112,111,119,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,\r
-118,101,99,52,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,112,111,119,0,18,\r
-118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,112,111,119,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,\r
-0,0,58,112,111,119,0,18,118,0,59,119,0,0,18,117,0,59,119,0,0,0,0,0,0,0,1,0,9,0,101,120,112,0,1,0,0,\r
-9,120,0,0,0,1,8,58,112,111,119,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,18,120,0,0,0,0,0,1,0,10,0,\r
-101,120,112,0,1,0,0,10,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,50,0,17,50,0,55,49,56,50,56,49,\r
-56,51,0,0,0,0,0,18,118,0,0,0,0,0,1,0,11,0,101,120,112,0,1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,58,\r
-118,101,99,51,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,18,118,0,0,0,0,0,1,0,12,0,101,120,112,0,\r
-1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,52,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,\r
-0,18,118,0,0,0,0,0,1,0,9,0,108,111,103,50,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,\r
-97,116,95,108,111,103,50,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,108,111,103,50,0,1,0,0,\r
-10,118,0,0,0,1,8,58,118,101,99,50,0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,\r
-0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,108,111,103,50,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,\r
-0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,0,18,118,0,59,121,0,0,0,0,58,108,\r
-111,103,50,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,108,111,103,50,0,1,0,0,12,118,0,0,0,1,8,58,118,\r
-101,99,52,0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,0,18,118,0,59,121,0,0,0,\r
-0,58,108,111,103,50,0,18,118,0,59,122,0,0,0,0,58,108,111,103,50,0,18,118,0,59,119,0,0,0,0,0,0,0,1,\r
-0,9,0,108,111,103,0,1,0,0,9,120,0,0,0,1,8,58,108,111,103,50,0,18,120,0,0,0,58,108,111,103,50,0,17,\r
-50,0,55,49,56,50,56,49,56,51,0,0,0,0,49,0,0,1,0,10,0,108,111,103,0,1,0,0,10,118,0,0,0,1,8,58,108,\r
-111,103,50,0,18,118,0,0,0,58,108,111,103,50,0,58,118,101,99,50,0,17,50,0,55,49,56,50,56,49,56,51,0,\r
-0,0,0,0,0,49,0,0,1,0,11,0,108,111,103,0,1,0,0,11,118,0,0,0,1,8,58,108,111,103,50,0,18,118,0,0,0,58,\r
-108,111,103,50,0,58,118,101,99,51,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,0,49,0,0,1,0,12,0,\r
-108,111,103,0,1,0,0,12,118,0,0,0,1,8,58,108,111,103,50,0,18,118,0,0,0,58,108,111,103,50,0,58,118,\r
-101,99,52,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,0,49,0,0,1,0,9,0,101,120,112,50,0,1,0,0,9,\r
-120,0,0,0,1,8,58,112,111,119,0,17,50,0,48,0,0,0,18,120,0,0,0,0,0,1,0,10,0,101,120,112,50,0,1,0,0,\r
-10,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,50,0,17,50,0,48,0,0,0,0,0,18,118,0,0,0,0,0,1,0,11,\r
-0,101,120,112,50,0,1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,51,0,17,50,0,48,0,0,0,0,0,\r
-18,118,0,0,0,0,0,1,0,12,0,101,120,112,50,0,1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,\r
-52,0,17,50,0,48,0,0,0,0,0,18,118,0,0,0,0,0,1,0,9,0,115,113,114,116,0,1,0,0,9,120,0,0,0,1,8,58,112,\r
-111,119,0,18,120,0,0,17,48,0,53,0,0,0,0,0,0,1,0,10,0,115,113,114,116,0,1,0,0,10,118,0,0,0,1,8,58,\r
-112,111,119,0,18,118,0,0,58,118,101,99,50,0,17,48,0,53,0,0,0,0,0,0,0,0,1,0,11,0,115,113,114,116,0,\r
-1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,18,118,0,0,58,118,101,99,51,0,17,48,0,53,0,0,0,0,0,0,0,0,1,\r
-0,12,0,115,113,114,116,0,1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,18,118,0,0,58,118,101,99,52,0,17,\r
-48,0,53,0,0,0,0,0,0,0,0,1,0,9,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,9,120,0,0,0,1,\r
-8,17,49,0,48,0,0,58,115,113,114,116,0,18,120,0,0,0,49,0,0,1,0,10,0,105,110,118,101,114,115,101,115,\r
-113,114,116,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,17,49,0,48,0,0,0,0,58,115,113,114,116,0,18,\r
-118,0,0,0,49,0,0,1,0,11,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,11,118,0,0,0,1,8,58,\r
-118,101,99,51,0,17,49,0,48,0,0,0,0,58,115,113,114,116,0,18,118,0,0,0,49,0,0,1,0,12,0,105,110,118,\r
-101,114,115,101,115,113,114,116,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,17,49,0,48,0,0,0,0,58,\r
-115,113,114,116,0,18,118,0,0,0,49,0,0,1,0,9,0,97,98,115,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,\r
-48,0,0,43,18,120,0,18,120,0,54,31,0,0,1,0,10,0,97,98,115,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,\r
-0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,115,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,\r
-98,115,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,\r
-115,0,18,118,0,59,121,0,0,0,0,58,97,98,115,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,98,115,0,1,\r
-0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,115,0,18,\r
-118,0,59,121,0,0,0,0,58,97,98,115,0,18,118,0,59,122,0,0,0,0,58,97,98,115,0,18,118,0,59,119,0,0,0,0,\r
-0,0,0,1,0,9,0,115,105,103,110,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,48,0,0,41,17,49,0,48,0,0,18,\r
-120,0,17,48,0,48,0,0,40,17,49,0,48,0,0,54,17,48,0,48,0,0,31,31,0,0,1,0,10,0,115,105,103,110,0,1,0,\r
-0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,\r
-110,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,105,103,110,0,1,0,0,11,118,0,0,0,1,8,58,118,101,\r
-99,51,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,110,0,18,118,0,59,121,0,0,0,0,\r
-58,115,105,103,110,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,103,110,0,1,0,0,12,118,0,0,0,1,\r
-8,58,118,101,99,52,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,110,0,18,118,0,59,\r
-121,0,0,0,0,58,115,105,103,110,0,18,118,0,59,122,0,0,0,0,58,115,105,103,110,0,18,118,0,59,119,0,0,\r
-0,0,0,0,0,1,0,9,0,102,108,111,111,114,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,97,\r
-116,95,102,108,111,111,114,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,102,108,111,111,114,0,\r
-1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,102,108,111,111,114,0,18,118,0,59,120,0,0,0,0,58,102,\r
-108,111,111,114,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,102,108,111,111,114,0,1,0,0,11,118,0,0,0,\r
-1,8,58,118,101,99,51,0,58,102,108,111,111,114,0,18,118,0,59,120,0,0,0,0,58,102,108,111,111,114,0,\r
-18,118,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,102,108,\r
-111,111,114,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,102,108,111,111,114,0,18,118,0,59,120,0,\r
-0,0,0,58,102,108,111,111,114,0,18,118,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,118,0,59,122,0,\r
-0,0,0,58,102,108,111,111,114,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,99,101,105,108,0,1,0,0,9,120,\r
-0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,97,116,95,99,101,105,108,0,18,121,0,0,18,120,0,0,0,8,18,\r
-121,0,0,0,1,0,10,0,99,101,105,108,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,99,101,105,108,0,\r
-18,118,0,59,120,0,0,0,0,58,99,101,105,108,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,99,101,105,108,\r
-0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,99,101,105,108,0,18,118,0,59,120,0,0,0,0,58,99,101,\r
-105,108,0,18,118,0,59,121,0,0,0,0,58,99,101,105,108,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,\r
-101,105,108,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,99,101,105,108,0,18,118,0,59,120,0,0,0,\r
-0,58,99,101,105,108,0,18,118,0,59,121,0,0,0,0,58,99,101,105,108,0,18,118,0,59,122,0,0,0,0,58,99,\r
-101,105,108,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,102,114,97,99,116,0,1,0,0,9,120,0,0,0,1,8,18,\r
-120,0,58,102,108,111,111,114,0,18,120,0,0,0,47,0,0,1,0,10,0,102,114,97,99,116,0,1,0,0,10,118,0,0,0,\r
-1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,11,0,102,114,97,99,116,0,1,0,0,11,\r
-118,0,0,0,1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,12,0,102,114,97,99,116,0,1,\r
-0,0,12,118,0,0,0,1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,9,0,109,111,100,0,1,\r
-0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,58,102,108,111,111,114,0,18,120,0,18,121,0,\r
-49,0,0,48,47,0,0,1,0,10,0,109,111,100,0,1,0,0,10,118,0,0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,\r
-58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,11,0,109,111,100,0,1,0,0,11,118,0,\r
-0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,\r
-0,0,1,0,12,0,109,111,100,0,1,0,0,12,118,0,0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,\r
-111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,10,0,109,111,100,0,1,0,0,10,118,0,0,1,0,0,10,117,\r
-0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,11,0,\r
-109,111,100,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,\r
-18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,12,0,109,111,100,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,\r
-18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,9,0,109,105,110,\r
-0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,40,18,120,0,18,121,0,31,0,0,1,0,10,0,109,\r
-105,110,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,118,101,99,50,0,58,109,105,110,0,18,118,0,59,\r
-120,0,0,18,117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,0,0,0,\r
-1,0,11,0,109,105,110,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,101,99,51,0,58,109,105,110,0,\r
-18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,\r
-0,0,0,58,109,105,110,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,0,0,0,1,0,12,0,109,105,110,0,1,\r
-0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,118,101,99,52,0,58,109,105,110,0,18,118,0,59,120,0,0,18,\r
-117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,109,105,110,0,\r
-18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,58,109,105,110,0,18,118,0,59,119,0,0,18,117,0,59,119,0,\r
-0,0,0,0,0,0,1,0,10,0,109,105,110,0,1,0,0,10,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,105,110,0,18,118,\r
-0,0,58,118,101,99,50,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,105,110,0,1,0,0,11,118,0,0,1,0,0,9,121,0,\r
-0,0,1,8,58,109,105,110,0,18,118,0,0,58,118,101,99,51,0,18,121,0,0,0,0,0,0,0,1,0,12,0,109,105,110,0,\r
-1,0,0,12,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,105,110,0,18,118,0,0,58,118,101,99,52,0,18,121,0,0,0,\r
-0,0,0,0,1,0,9,0,109,97,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,40,18,121,0,\r
-18,120,0,31,0,0,1,0,10,0,109,97,120,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,118,101,99,50,0,\r
-58,109,97,120,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,59,121,0,0,18,\r
-117,0,59,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,\r
-101,99,51,0,58,109,97,120,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,\r
-59,121,0,0,18,117,0,59,121,0,0,0,0,58,109,97,120,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,0,0,\r
-0,1,0,12,0,109,97,120,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,118,101,99,52,0,58,109,97,120,0,\r
-18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,59,121,0,0,18,117,0,59,121,0,\r
-0,0,0,58,109,97,120,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,58,109,97,120,0,18,118,0,59,119,\r
-0,0,18,117,0,59,119,0,0,0,0,0,0,0,1,0,10,0,109,97,120,0,1,0,0,10,118,0,0,1,0,0,9,121,0,0,0,1,8,58,\r
-109,97,120,0,18,118,0,0,58,118,101,99,50,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,0,1,0,0,11,118,\r
-0,0,1,0,0,9,121,0,0,0,1,8,58,109,97,120,0,18,118,0,0,58,118,101,99,51,0,18,121,0,0,0,0,0,0,0,1,0,\r
-12,0,109,97,120,0,1,0,0,12,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,97,120,0,18,118,0,0,58,118,101,99,\r
-52,0,18,121,0,0,0,0,0,0,0,1,0,9,0,99,108,97,109,112,0,1,0,0,9,120,0,0,1,0,0,9,109,105,110,86,97,\r
-108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,\r
-105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,0,0,10,\r
-120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,\r
-58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,\r
-11,0,99,108,97,109,112,0,1,0,0,11,120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,\r
-97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,\r
-109,97,120,86,97,108,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,9,109,105,110,\r
-86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,\r
-18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,\r
-0,0,10,120,0,0,1,0,0,10,109,105,110,86,97,108,0,0,1,0,0,10,109,97,120,86,97,108,0,0,0,1,8,58,109,\r
-105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,\r
-0,0,0,1,0,11,0,99,108,97,109,112,0,1,0,0,11,120,0,0,1,0,0,11,109,105,110,86,97,108,0,0,1,0,0,11,\r
-109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,\r
-108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,\r
-12,109,105,110,86,97,108,0,0,1,0,0,12,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,\r
-120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,9,0,109,\r
-105,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,1,0,0,9,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,\r
-48,18,121,0,18,97,0,48,46,0,0,1,0,10,0,109,105,120,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,1,0,0,9,97,\r
-0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,11,0,109,105,120,0,\r
-1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,9,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,\r
-121,0,18,97,0,48,46,0,0,1,0,12,0,109,105,120,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,1,0,0,9,97,0,0,0,\r
-1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,10,0,109,105,120,0,1,0,0,\r
-10,120,0,0,1,0,0,10,121,0,0,1,0,0,10,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,\r
-18,97,0,48,46,0,0,1,0,11,0,109,105,120,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,11,97,0,0,0,1,8,\r
-18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,12,0,109,105,120,0,1,0,0,12,\r
-120,0,0,1,0,0,12,121,0,0,1,0,0,12,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,\r
-97,0,48,46,0,0,1,0,9,0,115,116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,9,120,0,0,0,1,8,18,120,\r
-0,18,101,100,103,101,0,40,17,48,0,48,0,0,17,49,0,48,0,0,31,0,0,1,0,10,0,115,116,101,112,0,1,0,0,10,\r
-101,100,103,101,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,115,116,101,112,0,18,101,100,103,\r
-101,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,\r
-118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,11,101,100,103,101,0,0,1,0,0,11,118,0,\r
-0,0,1,8,58,118,101,99,51,0,58,115,116,101,112,0,18,101,100,103,101,0,59,120,0,0,18,118,0,59,120,0,\r
-0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,116,101,\r
-112,0,18,101,100,103,101,0,59,122,0,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,\r
-0,12,101,100,103,101,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,116,101,112,0,18,101,100,\r
-103,101,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,\r
-18,118,0,59,121,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,122,0,0,18,118,0,59,122,0,0,0,\r
-0,58,115,116,101,112,0,18,101,100,103,101,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,\r
-116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,10,118,0,0,0,1,8,58,115,116,101,112,0,58,118,101,\r
-99,50,0,18,101,100,103,101,0,0,0,0,18,118,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,9,101,100,103,\r
-101,0,0,1,0,0,11,118,0,0,0,1,8,58,115,116,101,112,0,58,118,101,99,51,0,18,101,100,103,101,0,0,0,0,\r
-18,118,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,12,118,0,0,0,1,8,58,\r
-115,116,101,112,0,58,118,101,99,52,0,18,101,100,103,101,0,0,0,0,18,118,0,0,0,0,0,1,0,9,0,115,109,\r
-111,111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,\r
-0,0,9,120,0,0,0,1,3,2,0,9,1,116,0,2,58,99,108,97,109,112,0,18,120,0,18,101,100,103,101,48,0,47,18,\r
-101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,\r
-116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,\r
-104,115,116,101,112,0,1,0,0,10,101,100,103,101,48,0,0,1,0,0,10,101,100,103,101,49,0,0,1,0,0,10,118,\r
-0,0,0,1,8,58,118,101,99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,\r
-59,120,0,0,18,101,100,103,101,49,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,\r
-115,116,101,112,0,18,101,100,103,101,48,0,59,121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,118,0,\r
-59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,11,101,100,103,101,\r
-48,0,0,1,0,0,11,101,100,103,101,49,0,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,115,109,111,\r
-111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,\r
-0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,\r
-121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,\r
-116,101,112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,118,0,59,\r
-122,0,0,0,0,0,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,12,101,100,103,101,48,0,\r
-0,1,0,0,12,101,100,103,101,49,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,111,116,\r
-104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,0,18,118,\r
-0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,121,0,0,\r
-18,101,100,103,101,49,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,116,101,\r
-112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,118,0,59,122,0,0,0,\r
-0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,119,0,0,18,101,100,103,\r
-101,49,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,\r
-0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,\r
-99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,\r
-49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,\r
-0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,111,116,104,115,\r
-116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,11,118,0,0,0,1,8,\r
-58,118,101,99,51,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,\r
-100,103,101,49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,\r
-103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,\r
-116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,122,0,0,0,0,0,0,0,1,\r
-0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,\r
-103,101,49,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,111,116,104,115,116,101,\r
-112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,\r
-111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,\r
-0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,\r
-49,0,0,18,118,0,59,122,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,\r
-0,0,18,101,100,103,101,49,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,100,111,116,0,1,0,0,9,120,0,0,\r
-1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,48,0,0,1,0,9,0,100,111,116,0,1,0,0,10,118,0,0,1,0,0,10,117,\r
-0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,18,118,0,59,121,0,18,117,0,59,121,0,48,46,0,0,1,0,\r
-9,0,100,111,116,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,\r
-18,118,0,59,121,0,18,117,0,59,121,0,48,46,18,118,0,59,122,0,18,117,0,59,122,0,48,46,0,0,1,0,9,0,\r
-100,111,116,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,18,\r
-118,0,59,121,0,18,117,0,59,121,0,48,46,18,118,0,59,122,0,18,117,0,59,122,0,48,46,18,118,0,59,119,0,\r
-18,117,0,59,119,0,48,46,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,9,120,0,0,0,1,8,58,115,113,114,\r
-116,0,58,100,111,116,0,18,120,0,0,18,120,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,10,\r
-118,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,1,0,9,0,108,\r
-101,110,103,116,104,0,1,0,0,11,118,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,\r
-118,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,12,118,0,0,0,1,8,58,115,113,114,116,0,58,\r
-100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,9,120,\r
-0,0,1,0,0,9,121,0,0,0,1,8,58,108,101,110,103,116,104,0,18,120,0,18,121,0,47,0,0,0,0,1,0,9,0,100,\r
-105,115,116,97,110,99,101,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,108,101,110,103,116,104,0,\r
-18,118,0,18,117,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,11,118,0,0,1,0,0,11,117,\r
-0,0,0,1,8,58,108,101,110,103,116,104,0,18,118,0,18,117,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,\r
-99,101,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,108,101,110,103,116,104,0,18,118,0,18,117,0,47,\r
-0,0,0,0,1,0,11,0,99,114,111,115,115,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,101,99,51,0,\r
-18,118,0,59,121,0,18,117,0,59,122,0,48,18,117,0,59,121,0,18,118,0,59,122,0,48,47,0,18,118,0,59,122,\r
-0,18,117,0,59,120,0,48,18,117,0,59,122,0,18,118,0,59,120,0,48,47,0,18,118,0,59,120,0,18,117,0,59,\r
-121,0,48,18,117,0,59,120,0,18,118,0,59,121,0,48,47,0,0,0,0,1,0,9,0,110,111,114,109,97,108,105,122,\r
-101,0,1,0,0,9,120,0,0,0,1,8,17,49,0,48,0,0,0,0,1,0,10,0,110,111,114,109,97,108,105,122,101,0,1,0,0,\r
-10,118,0,0,0,1,8,18,118,0,58,108,101,110,103,116,104,0,18,118,0,0,0,49,0,0,1,0,11,0,110,111,114,\r
-109,97,108,105,122,101,0,1,0,0,11,118,0,0,0,1,8,18,118,0,58,108,101,110,103,116,104,0,18,118,0,0,0,\r
-49,0,0,1,0,12,0,110,111,114,109,97,108,105,122,101,0,1,0,0,12,118,0,0,0,1,8,18,118,0,58,108,101,\r
-110,103,116,104,0,18,118,0,0,0,49,0,0,1,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,0,0,9,\r
-78,0,0,1,0,0,9,73,0,0,1,0,0,9,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,\r
-73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,10,0,102,97,99,101,102,111,114,119,97,114,\r
-100,0,1,0,0,10,78,0,0,1,0,0,10,73,0,0,1,0,0,10,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,\r
-101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,11,0,102,97,99,101,102,111,\r
-114,119,97,114,100,0,1,0,0,11,78,0,0,1,0,0,11,73,0,0,1,0,0,11,78,114,101,102,0,0,0,1,8,58,100,111,\r
-116,0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,12,0,102,\r
-97,99,101,102,111,114,119,97,114,100,0,1,0,0,12,78,0,0,1,0,0,12,73,0,0,1,0,0,12,78,114,101,102,0,0,\r
-0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,\r
-0,1,0,9,0,114,101,102,108,101,99,116,0,1,0,0,9,73,0,0,1,0,0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,\r
-58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,10,0,114,101,102,108,101,99,116,0,\r
-1,0,0,10,73,0,0,1,0,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,\r
-0,48,18,78,0,48,47,0,0,1,0,11,0,114,101,102,108,101,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,0,1,8,\r
-18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,12,0,114,\r
-101,102,108,101,99,116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,\r
-116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114,101,102,114,97,99,116,0,1,0,0,9,73,0,\r
-0,1,0,0,9,78,0,0,1,0,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,\r
-101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,\r
-18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,\r
-97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,\r
-107,0,0,0,46,18,78,0,48,47,0,0,1,0,10,0,114,101,102,114,97,99,116,0,1,0,0,10,73,0,0,1,0,0,10,78,0,\r
-0,1,0,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,\r
-17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,\r
-48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,\r
-18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,\r
-78,0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,1,0,0,9,101,\r
-116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,\r
-58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,\r
-18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,\r
-0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,\r
-1,0,12,0,114,101,102,114,97,99,116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,1,0,0,9,101,116,97,0,0,0,1,3,\r
-2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,\r
-18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,\r
-48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,\r
-0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,13,0,109,97,\r
-116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1,0,0,13,110,0,0,0,1,8,58,109,97,\r
-116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,\r
-0,57,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,14,109,0,0,1,\r
-0,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,\r
-16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,\r
-1,0,15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,15,109,0,0,1,0,0,15,110,0,0,\r
-0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,\r
-18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,\r
-57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,10,118,0,0,1,0,\r
-0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,\r
-0,18,117,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,11,118,0,0,1,0,0,11,\r
-117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,0,18,\r
-117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,115,84,104,\r
-97,110,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,\r
-59,120,0,40,0,18,118,0,59,121,0,18,117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,18,\r
-118,0,59,119,0,18,117,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,6,118,0,\r
-0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,\r
-121,0,18,117,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,7,118,0,0,1,0,0,7,\r
-117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,0,18,\r
-117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,115,84,104,\r
-97,110,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,\r
-120,0,40,0,18,118,0,59,121,0,18,117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,18,\r
-118,0,59,119,0,18,117,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,\r
-108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,\r
-120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,\r
-113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,\r
-18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,\r
-0,42,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,\r
-117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,\r
-117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,0,42,0,18,118,0,59,119,0,18,117,0,59,119,0,\r
-42,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,\r
-0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,\r
-59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,\r
-0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,\r
-18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,0,42,0,0,0,0,1,0,4,0,108,101,115,115,84,\r
-104,97,110,69,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,\r
-0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,\r
-117,0,59,122,0,42,0,18,118,0,59,119,0,18,117,0,59,119,0,42,0,0,0,0,1,0,2,0,103,114,101,97,116,101,\r
-114,84,104,97,110,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,\r
-0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,0,0,0,1,0,3,0,103,114,101,97,116,\r
-101,114,84,104,97,110,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,\r
-120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,\r
-59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,12,118,0,0,1,0,0,12,\r
-117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,\r
-117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,18,118,0,59,119,0,18,117,0,59,119,0,\r
-41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,\r
-8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,\r
-0,41,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,\r
-1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,\r
-121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,\r
-104,97,110,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,\r
-0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,\r
-18,118,0,59,119,0,18,117,0,59,119,0,41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,\r
-113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,\r
-18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,\r
-101,114,84,104,97,110,69,113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,\r
-51,0,18,118,0,59,120,0,18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,\r
-122,0,18,117,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,\r
-108,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,\r
-120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,0,18,117,0,59,122,0,43,0,18,\r
-118,0,59,119,0,18,117,0,59,119,0,43,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,\r
-113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,\r
-117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,101,\r
-114,84,104,97,110,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,\r
-18,118,0,59,120,0,18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,\r
-0,18,117,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,\r
-0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,\r
-43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,0,18,117,0,59,122,0,43,0,18,118,0,59,\r
-119,0,18,117,0,59,119,0,43,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,\r
-0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,\r
-121,0,38,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,\r
-101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,\r
-118,0,59,122,0,18,117,0,59,122,0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,\r
-117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,\r
-117,0,59,121,0,38,0,18,118,0,59,122,0,18,117,0,59,122,0,38,0,18,118,0,59,119,0,18,117,0,59,119,0,\r
-38,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,\r
-0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,0,0,0,1,0,3,0,\r
-101,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,\r
-18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,118,0,59,122,0,18,117,0,59,122,\r
-0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,\r
-52,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,118,0,59,\r
-122,0,18,117,0,59,122,0,38,0,18,118,0,59,119,0,18,117,0,59,119,0,38,0,0,0,0,1,0,2,0,110,111,116,69,\r
-113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,\r
-18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,116,69,113,\r
-117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,\r
-117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,18,118,0,59,122,0,18,117,0,59,122,0,\r
-39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,\r
-118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,\r
-18,118,0,59,122,0,18,117,0,59,122,0,39,0,18,118,0,59,119,0,18,117,0,59,119,0,39,0,0,0,0,1,0,2,0,\r
-110,111,116,69,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,\r
-0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,\r
-116,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,\r
-120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,18,118,0,59,122,0,18,117,0,\r
-59,122,0,39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,\r
-58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,\r
-39,0,18,118,0,59,122,0,18,117,0,59,122,0,39,0,18,118,0,59,119,0,18,117,0,59,119,0,39,0,0,0,0,1,0,1,\r
-0,97,110,121,0,1,0,0,2,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,0,0,1,0,1,0,97,110,121,\r
-0,1,0,0,3,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,18,118,0,59,122,0,32,0,0,1,0,1,0,97,\r
-110,121,0,1,0,0,4,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,18,118,0,59,122,0,32,18,118,\r
-0,59,119,0,32,0,0,1,0,1,0,97,108,108,0,1,0,0,2,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,\r
-34,0,0,1,0,1,0,97,108,108,0,1,0,0,3,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,34,18,118,0,\r
-59,122,0,34,0,0,1,0,1,0,97,108,108,0,1,0,0,4,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,34,\r
-18,118,0,59,122,0,34,18,118,0,59,119,0,34,0,0,1,0,2,0,110,111,116,0,1,0,0,2,118,0,0,0,1,8,58,98,\r
-118,101,99,50,0,18,118,0,59,120,0,56,0,18,118,0,59,121,0,56,0,0,0,0,1,0,3,0,110,111,116,0,1,0,0,3,\r
-118,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,\r
-0,56,0,0,0,0,1,0,4,0,110,111,116,0,1,0,0,4,118,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,\r
-56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,0,56,0,18,118,0,59,119,0,56,0,0,0,0,1,0,12,0,116,101,\r
-120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,\r
-0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,49,100,0,18,116,101,120,\r
-101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,\r
-116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,\r
-97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,\r
-68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,\r
-116,0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,\r
-112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,\r
-18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,\r
-0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,\r
-1,0,0,10,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,\r
-101,120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,\r
-100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,\r
-68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,\r
-58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,\r
-111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,\r
-18,99,111,111,114,100,0,59,112,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,\r
-111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,\r
-120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,\r
-100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,\r
-111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,\r
-109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,\r
-118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,\r
-18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,\r
-116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,\r
-114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,\r
-101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,\r
-114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,\r
-111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,\r
-0,19,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,\r
-108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,115,97,109,\r
-112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,\r
-0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,\r
-114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,49,100,0,18,\r
-116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,\r
-0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,\r
-115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,49,\r
-68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,\r
-111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,\r
-114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,\r
-108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,\r
-99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,\r
-99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,\r
-111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,\r
-0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,\r
-18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,\r
-116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,\r
-0,59,113,0,49,0,0,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,97,0,0,0,\r
-4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,\r
-111,105,115,101,49,0,1,0,0,10,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,\r
-115,101,50,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,11,120,0,\r
-0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,97,0,0,18,120,0,0,0,8,\r
-18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,12,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,\r
-97,116,95,110,111,105,115,101,52,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,10,0,110,111,105,115,\r
-101,50,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,\r
-110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,\r
-50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,\r
-111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,\r
-0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,\r
-105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,\r
-51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,\r
-50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,\r
-111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,\r
-0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,9,120,0,\r
-0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,\r
-18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,\r
-0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,\r
-105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,\r
-51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,\r
-17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,\r
-0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,\r
-115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,\r
-0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,\r
-55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,\r
-12,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,\r
-101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,\r
-0,17,50,0,55,55,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,\r
-52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,0,0,0,0,\r
-1,0,12,0,110,111,105,115,101,52,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,52,0,58,110,111,105,115,101,\r
-49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,\r
-105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,\r
-0,53,52,0,0,46,0,0,0,0,0,0,1,0,12,0,110,111,105,115,101,52,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,\r
-52,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,\r
-50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,\r
-118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,\r
-18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,0,0,0,0,1,0,12,\r
-0,110,111,105,115,101,52,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,52,0,58,110,111,105,115,101,49,0,\r
-18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,\r
-55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,\r
-51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,0,58,110,111,105,\r
-115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,\r
-57,49,0,0,0,0,46,0,0,0,0,0,0,1,0,12,0,110,111,105,115,101,52,0,1,0,0,12,120,0,0,0,1,8,58,118,101,\r
-99,52,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,\r
-99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,\r
-0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,\r
-0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,\r
-58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,\r
-52,56,0,0,0,0,46,0,0,0,0,0,0,0\r
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_common_builtin.gc */
+
+3,2,2,1,5,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,
+97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,
+101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,
+101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120,
+86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,10,49,54,0,0,0,2,2,1,5,1,103,108,95,77,97,
+120,86,101,114,116,101,120,85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,
+16,10,53,49,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,
+115,0,2,16,10,51,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,
+114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,1,5,1,103,108,95,77,97,120,67,
+111,109,98,105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,
+10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,
+116,115,0,2,16,10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116,85,110,105,
+102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,1,5,1,103,108,95,
+77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,4,15,1,103,108,95,77,111,
+100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,
+116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,
+119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,84,101,
+120,116,117,114,101,77,97,116,114,105,120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,
+67,111,111,114,100,115,0,0,0,2,2,4,14,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,
+0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,
+115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,
+110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,
+106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,
+108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0,3,18,103,108,
+95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,
+100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,
+1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,
+115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,
+105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,
+101,120,116,117,114,101,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,
+77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,100,
+101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,
+115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,
+110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,
+101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,
+114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,101,120,116,117,114,
+101,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,
+108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,9,1,103,108,95,78,
+111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,0,22,103,108,95,68,101,112,116,104,82,97,110,103,101,
+80,97,114,97,109,101,116,101,114,115,0,9,110,101,97,114,0,0,0,1,9,102,97,114,0,0,0,1,9,100,105,102,
+102,0,0,0,0,0,0,2,2,4,23,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114,97,109,101,116,
+101,114,115,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,4,12,1,103,108,95,67,108,
+105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,0,0,2,
+2,0,22,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,9,115,105,122,101,0,0,
+0,1,9,115,105,122,101,77,105,110,0,0,0,1,9,115,105,122,101,77,97,120,0,0,0,1,9,102,97,100,101,84,
+104,114,101,115,104,111,108,100,83,105,122,101,0,0,0,1,9,100,105,115,116,97,110,99,101,67,111,110,
+115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,110,99,
+101,76,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,
+110,99,101,81,117,97,100,114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,2,
+2,4,23,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,80,111,
+105,110,116,0,0,0,2,2,0,22,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,
+114,115,0,12,101,109,105,115,115,105,111,110,0,0,0,1,12,97,109,98,105,101,110,116,0,0,0,1,12,100,
+105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,9,115,104,105,110,105,110,
+101,115,115,0,0,0,0,0,0,2,2,4,23,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,
+101,114,115,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,4,23,103,108,
+95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,66,97,99,107,
+77,97,116,101,114,105,97,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,
+97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,100,105,102,102,117,
+115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,12,112,111,115,105,116,105,111,110,0,0,0,
+1,12,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,115,112,111,116,68,105,114,101,99,116,105,111,
+110,0,0,0,1,9,115,112,111,116,69,120,112,111,110,101,110,116,0,0,0,1,9,115,112,111,116,67,117,116,
+111,102,102,0,0,0,1,9,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0,0,1,9,99,111,110,115,
+116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,108,105,110,101,97,114,65,116,
+116,101,110,117,97,116,105,111,110,0,0,0,1,9,113,117,97,100,114,97,116,105,99,65,116,116,101,110,
+117,97,116,105,111,110,0,0,0,0,0,0,2,2,4,23,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,
+97,114,97,109,101,116,101,114,115,0,1,103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,
+103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,
+100,101,108,80,97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,0,0,0,2,2,4,
+23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,1,103,
+108,95,76,105,103,104,116,77,111,100,101,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,
+100,101,108,80,114,111,100,117,99,116,115,0,12,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,2,
+2,4,23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,
+95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,4,
+23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,95,
+66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,0,22,103,
+108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,
+100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,0,0,0,2,2,4,23,103,108,
+95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,70,114,111,110,116,76,105,103,
+104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,4,
+23,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,66,97,99,107,76,105,
+103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,
+4,12,1,103,108,95,84,101,120,116,117,114,101,69,110,118,67,111,108,111,114,0,3,18,103,108,95,77,97,
+120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,0,0,2,2,4,12,1,103,108,95,69,
+121,101,80,108,97,110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,
+100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,
+101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,
+110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,
+4,12,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,
+114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,
+83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,
+103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,
+117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,
+101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,
+12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,
+116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,0,22,103,108,95,70,111,103,80,97,114,97,109,101,
+116,101,114,115,0,12,99,111,108,111,114,0,0,0,1,9,100,101,110,115,105,116,121,0,0,0,1,9,115,116,97,
+114,116,0,0,0,1,9,101,110,100,0,0,0,1,9,115,99,97,108,101,0,0,0,0,0,0,2,2,4,23,103,108,95,70,111,
+103,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,70,111,103,0,0,0,1,0,9,0,114,97,100,105,97,
+110,115,0,1,0,0,9,100,101,103,0,0,0,1,8,17,51,0,49,52,49,53,57,51,0,0,18,100,101,103,0,48,17,49,56,
+48,0,48,0,0,49,0,0,1,0,10,0,114,97,100,105,97,110,115,0,1,0,0,10,100,101,103,0,0,0,1,8,58,118,101,
+99,50,0,17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,50,0,17,49,56,48,0,48,
+0,0,0,0,49,0,0,1,0,11,0,114,97,100,105,97,110,115,0,1,0,0,11,100,101,103,0,0,0,1,8,58,118,101,99,
+51,0,17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,51,0,17,49,56,48,0,48,0,0,
+0,0,49,0,0,1,0,12,0,114,97,100,105,97,110,115,0,1,0,0,12,100,101,103,0,0,0,1,8,58,118,101,99,52,0,
+17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,52,0,17,49,56,48,0,48,0,0,0,0,
+49,0,0,1,0,9,0,100,101,103,114,101,101,115,0,1,0,0,9,114,97,100,0,0,0,1,8,17,49,56,48,0,48,0,0,18,
+114,97,100,0,48,17,51,0,49,52,49,53,57,51,0,0,49,0,0,1,0,10,0,100,101,103,114,101,101,115,0,1,0,0,
+10,114,97,100,0,0,0,1,8,58,118,101,99,50,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,
+99,50,0,17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,11,0,100,101,103,114,101,101,115,0,1,0,0,11,
+114,97,100,0,0,0,1,8,58,118,101,99,51,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,99,
+51,0,17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,12,0,100,101,103,114,101,101,115,0,1,0,0,12,114,
+97,100,0,0,0,1,8,58,118,101,99,52,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,99,52,0,
+17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,9,0,115,105,110,0,1,0,0,9,97,110,103,108,101,0,0,0,1,
+3,2,0,9,1,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,120,0,0,18,97,110,103,108,101,0,0,
+0,8,18,120,0,0,0,1,0,10,0,115,105,110,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,101,99,50,0,
+58,115,105,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,
+59,121,0,0,0,0,0,0,0,1,0,11,0,115,105,110,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,101,99,51,
+0,58,115,105,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,
+59,121,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,110,
+0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,115,105,110,0,18,97,110,103,108,101,
+0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,115,105,110,0,18,97,
+110,103,108,101,0,59,122,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,0,
+9,0,99,111,115,0,1,0,0,9,97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,17,
+49,0,53,55,48,56,0,0,46,0,0,0,0,1,0,10,0,99,111,115,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,
+101,99,50,0,58,99,111,115,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,
+108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,99,111,115,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,
+101,99,51,0,58,99,111,115,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,
+108,101,0,59,121,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,
+111,115,0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,99,111,115,0,18,97,110,103,
+108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,99,111,115,0,18,
+97,110,103,108,101,0,59,122,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,
+0,9,0,116,97,110,0,1,0,0,9,97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,0,
+0,58,99,111,115,0,18,97,110,103,108,101,0,0,0,49,0,0,1,0,10,0,116,97,110,0,1,0,0,10,97,110,103,108,
+101,0,0,0,1,8,58,118,101,99,50,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,
+110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,116,97,110,0,1,0,0,11,97,110,103,108,
+101,0,0,0,1,8,58,118,101,99,51,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,
+110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,122,0,0,0,
+0,0,0,0,1,0,12,0,116,97,110,0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,116,97,
+110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,121,0,0,0,
+0,58,116,97,110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,
+59,119,0,0,0,0,0,0,0,1,0,9,0,97,115,105,110,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,
+111,97,116,95,97,114,99,115,105,110,101,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,97,115,
+105,110,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,
+97,115,105,110,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,115,105,110,0,1,0,0,11,118,0,0,0,1,8,58,
+118,101,99,51,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97,115,105,110,0,18,118,0,59,121,0,
+0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,115,105,110,0,1,0,0,12,118,0,0,
+0,1,8,58,118,101,99,52,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97,115,105,110,0,18,118,0,
+59,121,0,0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,58,97,115,105,110,0,18,118,0,59,119,0,0,
+0,0,0,0,0,1,0,9,0,97,99,111,115,0,1,0,0,9,120,0,0,0,1,8,17,49,0,53,55,48,56,0,0,58,97,115,105,110,
+0,18,120,0,0,0,47,0,0,1,0,10,0,97,99,111,115,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,97,99,
+111,115,0,18,118,0,59,120,0,0,0,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,99,
+111,115,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,0,58,
+97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,
+97,99,111,115,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,
+0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,0,58,97,99,
+111,115,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,116,97,110,0,1,0,0,9,121,95,111,118,101,114,95,
+120,0,0,0,1,3,2,0,9,1,122,0,0,0,4,102,108,111,97,116,95,97,114,99,116,97,110,0,18,122,0,0,18,121,
+95,111,118,101,114,95,120,0,0,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,121,95,111,118,
+101,114,95,120,0,0,0,1,8,58,118,101,99,50,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,
+59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,
+97,116,97,110,0,1,0,0,11,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,51,0,58,97,116,97,
+110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,
+114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,0,0,
+0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,52,0,
+58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,
+111,118,101,114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,
+122,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,
+116,97,110,0,1,0,0,9,121,0,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,122,0,2,58,97,116,97,110,0,18,121,0,18,
+120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,48,0,48,0,0,40,0,8,18,122,0,17,
+51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,46,0,0,9,14,0,8,18,
+122,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,117,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,
+97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,18,117,0,59,121,0,0,
+18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,116,97,110,0,1,0,0,11,117,0,0,1,0,0,11,118,0,0,0,1,8,58,
+118,101,99,51,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,
+18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,
+0,0,0,0,0,0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,117,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,
+58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,18,117,0,59,121,
+0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,0,58,97,
+116,97,110,0,18,117,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,112,111,119,0,1,0,0,9,120,0,
+0,1,0,0,9,121,0,0,0,1,3,2,0,9,1,112,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,112,0,0,
+18,120,0,0,18,121,0,0,0,8,18,112,0,0,0,1,0,10,0,112,111,119,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,
+1,8,58,118,101,99,50,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,112,111,119,
+0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,0,0,0,1,0,11,0,112,111,119,0,1,0,0,11,118,0,0,1,0,0,
+11,117,0,0,0,1,8,58,118,101,99,51,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,
+58,112,111,119,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,112,111,119,0,18,118,0,59,122,0,0,
+18,117,0,59,122,0,0,0,0,0,0,0,1,0,12,0,112,111,119,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,
+118,101,99,52,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,112,111,119,0,18,
+118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,112,111,119,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,
+0,0,58,112,111,119,0,18,118,0,59,119,0,0,18,117,0,59,119,0,0,0,0,0,0,0,1,0,9,0,101,120,112,0,1,0,0,
+9,120,0,0,0,1,8,58,112,111,119,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,18,120,0,0,0,0,0,1,0,10,0,
+101,120,112,0,1,0,0,10,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,50,0,17,50,0,55,49,56,50,56,49,
+56,51,0,0,0,0,0,18,118,0,0,0,0,0,1,0,11,0,101,120,112,0,1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,58,
+118,101,99,51,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,18,118,0,0,0,0,0,1,0,12,0,101,120,112,0,
+1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,52,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,
+0,18,118,0,0,0,0,0,1,0,9,0,108,111,103,50,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,
+97,116,95,108,111,103,50,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,108,111,103,50,0,1,0,0,
+10,118,0,0,0,1,8,58,118,101,99,50,0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,
+0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,108,111,103,50,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,
+0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,0,18,118,0,59,121,0,0,0,0,58,108,
+111,103,50,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,108,111,103,50,0,1,0,0,12,118,0,0,0,1,8,58,118,
+101,99,52,0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,0,18,118,0,59,121,0,0,0,
+0,58,108,111,103,50,0,18,118,0,59,122,0,0,0,0,58,108,111,103,50,0,18,118,0,59,119,0,0,0,0,0,0,0,1,
+0,9,0,108,111,103,0,1,0,0,9,120,0,0,0,1,8,58,108,111,103,50,0,18,120,0,0,0,58,108,111,103,50,0,17,
+50,0,55,49,56,50,56,49,56,51,0,0,0,0,49,0,0,1,0,10,0,108,111,103,0,1,0,0,10,118,0,0,0,1,8,58,108,
+111,103,50,0,18,118,0,0,0,58,108,111,103,50,0,58,118,101,99,50,0,17,50,0,55,49,56,50,56,49,56,51,0,
+0,0,0,0,0,49,0,0,1,0,11,0,108,111,103,0,1,0,0,11,118,0,0,0,1,8,58,108,111,103,50,0,18,118,0,0,0,58,
+108,111,103,50,0,58,118,101,99,51,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,0,49,0,0,1,0,12,0,
+108,111,103,0,1,0,0,12,118,0,0,0,1,8,58,108,111,103,50,0,18,118,0,0,0,58,108,111,103,50,0,58,118,
+101,99,52,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,0,49,0,0,1,0,9,0,101,120,112,50,0,1,0,0,9,
+120,0,0,0,1,8,58,112,111,119,0,17,50,0,48,0,0,0,18,120,0,0,0,0,0,1,0,10,0,101,120,112,50,0,1,0,0,
+10,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,50,0,17,50,0,48,0,0,0,0,0,18,118,0,0,0,0,0,1,0,11,
+0,101,120,112,50,0,1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,51,0,17,50,0,48,0,0,0,0,0,
+18,118,0,0,0,0,0,1,0,12,0,101,120,112,50,0,1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,
+52,0,17,50,0,48,0,0,0,0,0,18,118,0,0,0,0,0,1,0,9,0,115,113,114,116,0,1,0,0,9,120,0,0,0,1,8,58,112,
+111,119,0,18,120,0,0,17,48,0,53,0,0,0,0,0,0,1,0,10,0,115,113,114,116,0,1,0,0,10,118,0,0,0,1,8,58,
+112,111,119,0,18,118,0,0,58,118,101,99,50,0,17,48,0,53,0,0,0,0,0,0,0,0,1,0,11,0,115,113,114,116,0,
+1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,18,118,0,0,58,118,101,99,51,0,17,48,0,53,0,0,0,0,0,0,0,0,1,
+0,12,0,115,113,114,116,0,1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,18,118,0,0,58,118,101,99,52,0,17,
+48,0,53,0,0,0,0,0,0,0,0,1,0,9,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,9,120,0,0,0,1,
+8,17,49,0,48,0,0,58,115,113,114,116,0,18,120,0,0,0,49,0,0,1,0,10,0,105,110,118,101,114,115,101,115,
+113,114,116,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,17,49,0,48,0,0,0,0,58,115,113,114,116,0,18,
+118,0,0,0,49,0,0,1,0,11,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,11,118,0,0,0,1,8,58,
+118,101,99,51,0,17,49,0,48,0,0,0,0,58,115,113,114,116,0,18,118,0,0,0,49,0,0,1,0,12,0,105,110,118,
+101,114,115,101,115,113,114,116,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,17,49,0,48,0,0,0,0,58,
+115,113,114,116,0,18,118,0,0,0,49,0,0,1,0,9,0,97,98,115,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,
+48,0,0,43,18,120,0,18,120,0,54,31,0,0,1,0,10,0,97,98,115,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,
+0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,115,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,
+98,115,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,
+115,0,18,118,0,59,121,0,0,0,0,58,97,98,115,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,98,115,0,1,
+0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,115,0,18,
+118,0,59,121,0,0,0,0,58,97,98,115,0,18,118,0,59,122,0,0,0,0,58,97,98,115,0,18,118,0,59,119,0,0,0,0,
+0,0,0,1,0,9,0,115,105,103,110,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,48,0,0,41,17,49,0,48,0,0,18,
+120,0,17,48,0,48,0,0,40,17,49,0,48,0,0,54,17,48,0,48,0,0,31,31,0,0,1,0,10,0,115,105,103,110,0,1,0,
+0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,
+110,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,105,103,110,0,1,0,0,11,118,0,0,0,1,8,58,118,101,
+99,51,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,110,0,18,118,0,59,121,0,0,0,0,
+58,115,105,103,110,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,103,110,0,1,0,0,12,118,0,0,0,1,
+8,58,118,101,99,52,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,110,0,18,118,0,59,
+121,0,0,0,0,58,115,105,103,110,0,18,118,0,59,122,0,0,0,0,58,115,105,103,110,0,18,118,0,59,119,0,0,
+0,0,0,0,0,1,0,9,0,102,108,111,111,114,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,97,
+116,95,102,108,111,111,114,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,102,108,111,111,114,0,
+1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,102,108,111,111,114,0,18,118,0,59,120,0,0,0,0,58,102,
+108,111,111,114,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,102,108,111,111,114,0,1,0,0,11,118,0,0,0,
+1,8,58,118,101,99,51,0,58,102,108,111,111,114,0,18,118,0,59,120,0,0,0,0,58,102,108,111,111,114,0,
+18,118,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,102,108,
+111,111,114,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,102,108,111,111,114,0,18,118,0,59,120,0,
+0,0,0,58,102,108,111,111,114,0,18,118,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,118,0,59,122,0,
+0,0,0,58,102,108,111,111,114,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,99,101,105,108,0,1,0,0,9,120,
+0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,97,116,95,99,101,105,108,0,18,121,0,0,18,120,0,0,0,8,18,
+121,0,0,0,1,0,10,0,99,101,105,108,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,99,101,105,108,0,
+18,118,0,59,120,0,0,0,0,58,99,101,105,108,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,99,101,105,108,
+0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,99,101,105,108,0,18,118,0,59,120,0,0,0,0,58,99,101,
+105,108,0,18,118,0,59,121,0,0,0,0,58,99,101,105,108,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,
+101,105,108,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,99,101,105,108,0,18,118,0,59,120,0,0,0,
+0,58,99,101,105,108,0,18,118,0,59,121,0,0,0,0,58,99,101,105,108,0,18,118,0,59,122,0,0,0,0,58,99,
+101,105,108,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,102,114,97,99,116,0,1,0,0,9,120,0,0,0,1,8,18,
+120,0,58,102,108,111,111,114,0,18,120,0,0,0,47,0,0,1,0,10,0,102,114,97,99,116,0,1,0,0,10,118,0,0,0,
+1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,11,0,102,114,97,99,116,0,1,0,0,11,
+118,0,0,0,1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,12,0,102,114,97,99,116,0,1,
+0,0,12,118,0,0,0,1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,9,0,109,111,100,0,1,
+0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,58,102,108,111,111,114,0,18,120,0,18,121,0,
+49,0,0,48,47,0,0,1,0,10,0,109,111,100,0,1,0,0,10,118,0,0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,
+58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,11,0,109,111,100,0,1,0,0,11,118,0,
+0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,
+0,0,1,0,12,0,109,111,100,0,1,0,0,12,118,0,0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,
+111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,10,0,109,111,100,0,1,0,0,10,118,0,0,1,0,0,10,117,
+0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,11,0,
+109,111,100,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,
+18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,12,0,109,111,100,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,
+18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,9,0,109,105,110,
+0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,40,18,120,0,18,121,0,31,0,0,1,0,10,0,109,
+105,110,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,118,101,99,50,0,58,109,105,110,0,18,118,0,59,
+120,0,0,18,117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,0,0,0,
+1,0,11,0,109,105,110,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,101,99,51,0,58,109,105,110,0,
+18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,
+0,0,0,58,109,105,110,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,0,0,0,1,0,12,0,109,105,110,0,1,
+0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,118,101,99,52,0,58,109,105,110,0,18,118,0,59,120,0,0,18,
+117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,109,105,110,0,
+18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,58,109,105,110,0,18,118,0,59,119,0,0,18,117,0,59,119,0,
+0,0,0,0,0,0,1,0,10,0,109,105,110,0,1,0,0,10,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,105,110,0,18,118,
+0,0,58,118,101,99,50,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,105,110,0,1,0,0,11,118,0,0,1,0,0,9,121,0,
+0,0,1,8,58,109,105,110,0,18,118,0,0,58,118,101,99,51,0,18,121,0,0,0,0,0,0,0,1,0,12,0,109,105,110,0,
+1,0,0,12,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,105,110,0,18,118,0,0,58,118,101,99,52,0,18,121,0,0,0,
+0,0,0,0,1,0,9,0,109,97,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,40,18,121,0,
+18,120,0,31,0,0,1,0,10,0,109,97,120,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,118,101,99,50,0,
+58,109,97,120,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,59,121,0,0,18,
+117,0,59,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,
+101,99,51,0,58,109,97,120,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,
+59,121,0,0,18,117,0,59,121,0,0,0,0,58,109,97,120,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,0,0,
+0,1,0,12,0,109,97,120,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,118,101,99,52,0,58,109,97,120,0,
+18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,59,121,0,0,18,117,0,59,121,0,
+0,0,0,58,109,97,120,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,58,109,97,120,0,18,118,0,59,119,
+0,0,18,117,0,59,119,0,0,0,0,0,0,0,1,0,10,0,109,97,120,0,1,0,0,10,118,0,0,1,0,0,9,121,0,0,0,1,8,58,
+109,97,120,0,18,118,0,0,58,118,101,99,50,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,0,1,0,0,11,118,
+0,0,1,0,0,9,121,0,0,0,1,8,58,109,97,120,0,18,118,0,0,58,118,101,99,51,0,18,121,0,0,0,0,0,0,0,1,0,
+12,0,109,97,120,0,1,0,0,12,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,97,120,0,18,118,0,0,58,118,101,99,
+52,0,18,121,0,0,0,0,0,0,0,1,0,9,0,99,108,97,109,112,0,1,0,0,9,120,0,0,1,0,0,9,109,105,110,86,97,
+108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,
+105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,0,0,10,
+120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,
+58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,
+11,0,99,108,97,109,112,0,1,0,0,11,120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,
+97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,
+109,97,120,86,97,108,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,9,109,105,110,
+86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,
+18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,
+0,0,10,120,0,0,1,0,0,10,109,105,110,86,97,108,0,0,1,0,0,10,109,97,120,86,97,108,0,0,0,1,8,58,109,
+105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,
+0,0,0,1,0,11,0,99,108,97,109,112,0,1,0,0,11,120,0,0,1,0,0,11,109,105,110,86,97,108,0,0,1,0,0,11,
+109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,
+108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,
+12,109,105,110,86,97,108,0,0,1,0,0,12,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,
+120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,9,0,109,
+105,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,1,0,0,9,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,
+48,18,121,0,18,97,0,48,46,0,0,1,0,10,0,109,105,120,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,1,0,0,9,97,
+0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,11,0,109,105,120,0,
+1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,9,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,
+121,0,18,97,0,48,46,0,0,1,0,12,0,109,105,120,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,1,0,0,9,97,0,0,0,
+1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,10,0,109,105,120,0,1,0,0,
+10,120,0,0,1,0,0,10,121,0,0,1,0,0,10,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,
+18,97,0,48,46,0,0,1,0,11,0,109,105,120,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,11,97,0,0,0,1,8,
+18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,12,0,109,105,120,0,1,0,0,12,
+120,0,0,1,0,0,12,121,0,0,1,0,0,12,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,
+97,0,48,46,0,0,1,0,9,0,115,116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,9,120,0,0,0,1,8,18,120,
+0,18,101,100,103,101,0,40,17,48,0,48,0,0,17,49,0,48,0,0,31,0,0,1,0,10,0,115,116,101,112,0,1,0,0,10,
+101,100,103,101,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,115,116,101,112,0,18,101,100,103,
+101,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,
+118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,11,101,100,103,101,0,0,1,0,0,11,118,0,
+0,0,1,8,58,118,101,99,51,0,58,115,116,101,112,0,18,101,100,103,101,0,59,120,0,0,18,118,0,59,120,0,
+0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,116,101,
+112,0,18,101,100,103,101,0,59,122,0,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,
+0,12,101,100,103,101,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,116,101,112,0,18,101,100,
+103,101,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,
+18,118,0,59,121,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,122,0,0,18,118,0,59,122,0,0,0,
+0,58,115,116,101,112,0,18,101,100,103,101,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,
+116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,10,118,0,0,0,1,8,58,115,116,101,112,0,58,118,101,
+99,50,0,18,101,100,103,101,0,0,0,0,18,118,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,9,101,100,103,
+101,0,0,1,0,0,11,118,0,0,0,1,8,58,115,116,101,112,0,58,118,101,99,51,0,18,101,100,103,101,0,0,0,0,
+18,118,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,12,118,0,0,0,1,8,58,
+115,116,101,112,0,58,118,101,99,52,0,18,101,100,103,101,0,0,0,0,18,118,0,0,0,0,0,1,0,9,0,115,109,
+111,111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,
+0,0,9,120,0,0,0,1,3,2,0,9,1,116,0,2,58,99,108,97,109,112,0,18,120,0,18,101,100,103,101,48,0,47,18,
+101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,
+116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,
+104,115,116,101,112,0,1,0,0,10,101,100,103,101,48,0,0,1,0,0,10,101,100,103,101,49,0,0,1,0,0,10,118,
+0,0,0,1,8,58,118,101,99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,
+59,120,0,0,18,101,100,103,101,49,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,
+115,116,101,112,0,18,101,100,103,101,48,0,59,121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,118,0,
+59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,11,101,100,103,101,
+48,0,0,1,0,0,11,101,100,103,101,49,0,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,115,109,111,
+111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,
+0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,
+121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,
+116,101,112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,118,0,59,
+122,0,0,0,0,0,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,12,101,100,103,101,48,0,
+0,1,0,0,12,101,100,103,101,49,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,111,116,
+104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,0,18,118,
+0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,121,0,0,
+18,101,100,103,101,49,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,116,101,
+112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,118,0,59,122,0,0,0,
+0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,119,0,0,18,101,100,103,
+101,49,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,
+0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,
+99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,
+49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,
+0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,111,116,104,115,
+116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,11,118,0,0,0,1,8,
+58,118,101,99,51,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,
+100,103,101,49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,
+103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,
+116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,122,0,0,0,0,0,0,0,1,
+0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,
+103,101,49,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,111,116,104,115,116,101,
+112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,
+111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,
+0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,
+49,0,0,18,118,0,59,122,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,
+0,0,18,101,100,103,101,49,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,100,111,116,0,1,0,0,9,120,0,0,
+1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,48,0,0,1,0,9,0,100,111,116,0,1,0,0,10,118,0,0,1,0,0,10,117,
+0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,18,118,0,59,121,0,18,117,0,59,121,0,48,46,0,0,1,0,
+9,0,100,111,116,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,
+18,118,0,59,121,0,18,117,0,59,121,0,48,46,18,118,0,59,122,0,18,117,0,59,122,0,48,46,0,0,1,0,9,0,
+100,111,116,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,18,
+118,0,59,121,0,18,117,0,59,121,0,48,46,18,118,0,59,122,0,18,117,0,59,122,0,48,46,18,118,0,59,119,0,
+18,117,0,59,119,0,48,46,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,9,120,0,0,0,1,8,58,115,113,114,
+116,0,58,100,111,116,0,18,120,0,0,18,120,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,10,
+118,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,1,0,9,0,108,
+101,110,103,116,104,0,1,0,0,11,118,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,
+118,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,12,118,0,0,0,1,8,58,115,113,114,116,0,58,
+100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,9,120,
+0,0,1,0,0,9,121,0,0,0,1,8,58,108,101,110,103,116,104,0,18,120,0,18,121,0,47,0,0,0,0,1,0,9,0,100,
+105,115,116,97,110,99,101,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,108,101,110,103,116,104,0,
+18,118,0,18,117,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,11,118,0,0,1,0,0,11,117,
+0,0,0,1,8,58,108,101,110,103,116,104,0,18,118,0,18,117,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,
+99,101,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,108,101,110,103,116,104,0,18,118,0,18,117,0,47,
+0,0,0,0,1,0,11,0,99,114,111,115,115,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,101,99,51,0,
+18,118,0,59,121,0,18,117,0,59,122,0,48,18,117,0,59,121,0,18,118,0,59,122,0,48,47,0,18,118,0,59,122,
+0,18,117,0,59,120,0,48,18,117,0,59,122,0,18,118,0,59,120,0,48,47,0,18,118,0,59,120,0,18,117,0,59,
+121,0,48,18,117,0,59,120,0,18,118,0,59,121,0,48,47,0,0,0,0,1,0,9,0,110,111,114,109,97,108,105,122,
+101,0,1,0,0,9,120,0,0,0,1,8,17,49,0,48,0,0,0,0,1,0,10,0,110,111,114,109,97,108,105,122,101,0,1,0,0,
+10,118,0,0,0,1,8,18,118,0,58,108,101,110,103,116,104,0,18,118,0,0,0,49,0,0,1,0,11,0,110,111,114,
+109,97,108,105,122,101,0,1,0,0,11,118,0,0,0,1,8,18,118,0,58,108,101,110,103,116,104,0,18,118,0,0,0,
+49,0,0,1,0,12,0,110,111,114,109,97,108,105,122,101,0,1,0,0,12,118,0,0,0,1,8,18,118,0,58,108,101,
+110,103,116,104,0,18,118,0,0,0,49,0,0,1,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,0,0,9,
+78,0,0,1,0,0,9,73,0,0,1,0,0,9,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,
+73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,10,0,102,97,99,101,102,111,114,119,97,114,
+100,0,1,0,0,10,78,0,0,1,0,0,10,73,0,0,1,0,0,10,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,
+101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,11,0,102,97,99,101,102,111,
+114,119,97,114,100,0,1,0,0,11,78,0,0,1,0,0,11,73,0,0,1,0,0,11,78,114,101,102,0,0,0,1,8,58,100,111,
+116,0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,12,0,102,
+97,99,101,102,111,114,119,97,114,100,0,1,0,0,12,78,0,0,1,0,0,12,73,0,0,1,0,0,12,78,114,101,102,0,0,
+0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,
+0,1,0,9,0,114,101,102,108,101,99,116,0,1,0,0,9,73,0,0,1,0,0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,
+58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,10,0,114,101,102,108,101,99,116,0,
+1,0,0,10,73,0,0,1,0,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,
+0,48,18,78,0,48,47,0,0,1,0,11,0,114,101,102,108,101,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,0,1,8,
+18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,12,0,114,
+101,102,108,101,99,116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,
+116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114,101,102,114,97,99,116,0,1,0,0,9,73,0,
+0,1,0,0,9,78,0,0,1,0,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,
+101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,
+18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,
+97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,
+107,0,0,0,46,18,78,0,48,47,0,0,1,0,10,0,114,101,102,114,97,99,116,0,1,0,0,10,73,0,0,1,0,0,10,78,0,
+0,1,0,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,
+17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,
+48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,
+18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,
+78,0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,1,0,0,9,101,
+116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,
+58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,
+18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,
+0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,
+1,0,12,0,114,101,102,114,97,99,116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,1,0,0,9,101,116,97,0,0,0,1,3,
+2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,
+18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,
+48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,
+0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,13,0,109,97,
+116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1,0,0,13,110,0,0,0,1,8,58,109,97,
+116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
+0,57,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,14,109,0,0,1,
+0,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,
+16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,
+1,0,15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,15,109,0,0,1,0,0,15,110,0,0,
+0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,
+18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,
+57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,10,118,0,0,1,0,
+0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,
+0,18,117,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,11,118,0,0,1,0,0,11,
+117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,0,18,
+117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,115,84,104,
+97,110,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,
+59,120,0,40,0,18,118,0,59,121,0,18,117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,18,
+118,0,59,119,0,18,117,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,6,118,0,
+0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,
+121,0,18,117,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,7,118,0,0,1,0,0,7,
+117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,0,18,
+117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,115,84,104,
+97,110,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,
+120,0,40,0,18,118,0,59,121,0,18,117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,18,
+118,0,59,119,0,18,117,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,
+108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,
+120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,
+113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,
+18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,
+0,42,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,
+117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,
+117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,0,42,0,18,118,0,59,119,0,18,117,0,59,119,0,
+42,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,
+0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,
+59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,
+0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,
+18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,0,42,0,0,0,0,1,0,4,0,108,101,115,115,84,
+104,97,110,69,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,
+0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,
+117,0,59,122,0,42,0,18,118,0,59,119,0,18,117,0,59,119,0,42,0,0,0,0,1,0,2,0,103,114,101,97,116,101,
+114,84,104,97,110,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,
+0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,0,0,0,1,0,3,0,103,114,101,97,116,
+101,114,84,104,97,110,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,
+120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,
+59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,12,118,0,0,1,0,0,12,
+117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,
+117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,18,118,0,59,119,0,18,117,0,59,119,0,
+41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,
+8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,
+0,41,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,
+1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,
+121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,
+104,97,110,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,
+0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,
+18,118,0,59,119,0,18,117,0,59,119,0,41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,
+113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,
+18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,
+101,114,84,104,97,110,69,113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,
+51,0,18,118,0,59,120,0,18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,
+122,0,18,117,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,
+108,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,
+120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,0,18,117,0,59,122,0,43,0,18,
+118,0,59,119,0,18,117,0,59,119,0,43,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,
+113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,
+117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,101,
+114,84,104,97,110,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,
+18,118,0,59,120,0,18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,
+0,18,117,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,
+0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,
+43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,0,18,117,0,59,122,0,43,0,18,118,0,59,
+119,0,18,117,0,59,119,0,43,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,
+0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,
+121,0,38,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,
+101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,
+118,0,59,122,0,18,117,0,59,122,0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,
+117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,
+117,0,59,121,0,38,0,18,118,0,59,122,0,18,117,0,59,122,0,38,0,18,118,0,59,119,0,18,117,0,59,119,0,
+38,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,
+0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,0,0,0,1,0,3,0,
+101,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,
+18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,118,0,59,122,0,18,117,0,59,122,
+0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,
+52,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,118,0,59,
+122,0,18,117,0,59,122,0,38,0,18,118,0,59,119,0,18,117,0,59,119,0,38,0,0,0,0,1,0,2,0,110,111,116,69,
+113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,
+18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,116,69,113,
+117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,
+117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,18,118,0,59,122,0,18,117,0,59,122,0,
+39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,
+118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,
+18,118,0,59,122,0,18,117,0,59,122,0,39,0,18,118,0,59,119,0,18,117,0,59,119,0,39,0,0,0,0,1,0,2,0,
+110,111,116,69,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,
+0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,
+116,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,
+120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,18,118,0,59,122,0,18,117,0,
+59,122,0,39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,
+58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,
+39,0,18,118,0,59,122,0,18,117,0,59,122,0,39,0,18,118,0,59,119,0,18,117,0,59,119,0,39,0,0,0,0,1,0,1,
+0,97,110,121,0,1,0,0,2,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,0,0,1,0,1,0,97,110,121,
+0,1,0,0,3,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,18,118,0,59,122,0,32,0,0,1,0,1,0,97,
+110,121,0,1,0,0,4,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,18,118,0,59,122,0,32,18,118,
+0,59,119,0,32,0,0,1,0,1,0,97,108,108,0,1,0,0,2,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,
+34,0,0,1,0,1,0,97,108,108,0,1,0,0,3,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,34,18,118,0,
+59,122,0,34,0,0,1,0,1,0,97,108,108,0,1,0,0,4,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,34,
+18,118,0,59,122,0,34,18,118,0,59,119,0,34,0,0,1,0,2,0,110,111,116,0,1,0,0,2,118,0,0,0,1,8,58,98,
+118,101,99,50,0,18,118,0,59,120,0,56,0,18,118,0,59,121,0,56,0,0,0,0,1,0,3,0,110,111,116,0,1,0,0,3,
+118,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,
+0,56,0,0,0,0,1,0,4,0,110,111,116,0,1,0,0,4,118,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,
+56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,0,56,0,18,118,0,59,119,0,56,0,0,0,0,1,0,12,0,116,101,
+120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,
+0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,49,100,0,18,116,101,120,
+101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,
+116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,
+97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,
+68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
+116,0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,
+112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,
+18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,
+0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,
+1,0,0,10,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,
+101,120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
+100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,
+68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,
+58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,
+111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,
+18,99,111,111,114,100,0,59,112,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,
+111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,
+120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,
+100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,
+111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,
+109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,
+118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,
+18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,
+116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,
+114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,
+101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,
+114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,
+111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,
+0,19,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,
+108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,115,97,109,
+112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,
+0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,
+114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,49,100,0,18,
+116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,
+0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,
+115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,49,
+68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,
+111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,
+114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,
+108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,
+99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,
+99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,
+111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,
+0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,
+18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,
+116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,
+0,59,113,0,49,0,0,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,97,0,0,0,
+4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,
+111,105,115,101,49,0,1,0,0,10,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,
+115,101,50,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,11,120,0,
+0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,97,0,0,18,120,0,0,0,8,
+18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,12,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,
+97,116,95,110,111,105,115,101,52,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,10,0,110,111,105,115,
+101,50,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,
+110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,
+50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,
+111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,
+0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,
+105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,
+51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,
+50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,
+111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,
+0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,9,120,0,
+0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,
+18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,
+0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,
+105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,
+51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,
+17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,
+0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,
+115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,
+0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,
+55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,
+12,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,
+101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,
+0,17,50,0,55,55,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,
+52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,0,0,0,0,
+1,0,12,0,110,111,105,115,101,52,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,52,0,58,110,111,105,115,101,
+49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,
+105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,
+0,53,52,0,0,46,0,0,0,0,0,0,1,0,12,0,110,111,105,115,101,52,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,
+52,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,
+50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,
+118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,
+18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,0,0,0,0,1,0,12,
+0,110,111,105,115,101,52,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,52,0,58,110,111,105,115,101,49,0,
+18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,
+55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,
+51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,0,58,110,111,105,
+115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,
+57,49,0,0,0,0,46,0,0,0,0,0,0,1,0,12,0,110,111,105,115,101,52,0,1,0,0,12,120,0,0,0,1,8,58,118,101,
+99,52,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,
+99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,
+0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,
+0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,
+58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,
+52,56,0,0,0,0,46,0,0,0,0,0,0,0
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-//\r
-// This file defines nearly all constructors and operators for built-in data types, using\r
-// extended language syntax. In general, compiler treats constructors and operators as\r
-// ordinary functions with some exceptions. For example, the language does not allow\r
-// functions to be called in constant expressions - here the exception is made to allow it.\r
-//\r
-// Each implementation provides its own version of this file. Each implementation can define\r
-// the required set of operators and constructors in its own fashion.\r
-//\r
-// The extended language syntax is only present when compiling this file. It is implicitly\r
-// included at the very beginning of the compiled shader, so no built-in functions can be\r
-// used.\r
-//\r
-// To communicate with the implementation, a special extended "__asm" keyword is used, followed\r
-// by an instruction name (any valid identifier), a destination variable identifier and a\r
-// a list of zero or more source variable identifiers. A variable identifier is a variable name\r
-// declared earlier in the code (as a function parameter, local or global variable).\r
-// An instruction name designates an instruction that must be exported by the implementation.\r
-// Each instruction receives data from source variable identifiers and returns data in the\r
-// destination variable identifier.\r
-//\r
-// It is up to the implementation how to define a particular operator or constructor. If it is\r
-// expected to being used rarely, it can be defined in terms of other operators and constructors,\r
-// for example:\r
-//\r
-// ivec2 __operator + (const ivec2 x, const ivec2 y) {\r
-// return ivec2 (x[0] + y[0], x[1] + y[1]);\r
-// }\r
-//\r
-// If a particular operator or constructor is expected to be used very often or is an atomic\r
-// operation (that is, an operation that cannot be expressed in terms of other operations or\r
-// would create a dependency cycle) it must be defined using one or more __asm constructs.\r
-//\r
-// Each implementation must define constructors for all scalar types (bool, float, int).\r
-// There are 9 scalar-to-scalar constructors (including identity constructors). However,\r
-// since the language introduces special constructors (like matrix constructor with a single\r
-// scalar value), implementations must also implement these cases.\r
-// The compiler provides the following algorithm when resolving a constructor:\r
-// - try to find a constructor with a prototype matching ours,\r
-// - if no constructor is found and this is a scalar-to-scalar constructor, raise an error,\r
-// - if a constructor is found, execute it and return,\r
-// - count the size of the constructor parameter list - if it is less than the size of\r
-// our constructor's type, raise an error,\r
-// - for each parameter in the list do a recursive constructor matching for appropriate\r
-// scalar fields in the constructed variable,\r
-//\r
-// Each implementation must also define a set of operators that deal with built-in data types.\r
-// There are four kinds of operators:\r
-// 1) Operators that are implemented only by the compiler: "()" (function call), "," (sequence)\r
-// and "?:" (selection).\r
-// 2) Operators that are implemented by the compiler by expressing it in terms of other operators:\r
-// - "." (field selection) - translated to subscript access,\r
-// - "&&" (logical and) - translated to "<left_expr> ? <right_expr> : false",\r
-// - "||" (logical or) - translated to "<left_expr> ? true : <right_expr>",\r
-// 3) Operators that can be defined by the implementation and if the required prototype is not\r
-// found, standard behaviour is used:\r
-// - "==", "!=", "=" (equality, assignment) - compare or assign matching fields one-by-one;\r
-// note that at least operators for scalar data types must be defined by the implementation\r
-// to get it work,\r
-// 4) All other operators not mentioned above. If no required prototype is found, an error is\r
-// raised. An implementation must follow the language specification to provide all valid\r
-// operator prototypes.\r
-//\r
-\r
-int __constructor (const float f) {\r
- int i;\r
- __asm float_to_int i, f;\r
- return i;\r
-}\r
-\r
-bool __constructor (const int i) {\r
- return i != 0;\r
-}\r
-\r
-bool __constructor (const float f) {\r
- return f != 0.0;\r
-}\r
-\r
-int __constructor (const bool b) {\r
- return b ? 1 : 0;\r
-}\r
-\r
-float __constructor (const bool b) {\r
- return b ? 1.0 : 0.0;\r
-}\r
-\r
-float __constructor (const int i) {\r
- float f;\r
- __asm int_to_float f, i;\r
- return f;\r
-}\r
-\r
-bool __constructor (const bool b) {\r
- return b;\r
-}\r
-\r
-int __constructor (const int i) {\r
- return i;\r
-}\r
-\r
-float __constructor (const float f) {\r
- return f;\r
-}\r
-\r
-vec2 __constructor (const float f) {\r
- return vec2 (f, f);\r
-}\r
-\r
-vec2 __constructor (const int i) {\r
- float x;\r
- __asm int_to_float x, i;\r
- return vec2 (x);\r
-}\r
-\r
-vec2 __constructor (const bool b) {\r
- return vec2 (b ? 1.0 : 0.0);\r
-}\r
-\r
-vec3 __constructor (const float f) {\r
- return vec3 (f, f, f);\r
-}\r
-\r
-vec3 __constructor (const int i) {\r
- float x;\r
- __asm int_to_float x, i;\r
- return vec3 (x);\r
-}\r
-\r
-vec3 __constructor (const bool b) {\r
- return vec3 (b ? 1.0 : 0.0);\r
-}\r
-\r
-vec4 __constructor (const float f) {\r
- return vec4 (f, f, f, f);\r
-}\r
-\r
-vec4 __constructor (const int i) {\r
- float x;\r
- __asm int_to_float x, i;\r
- return vec4 (x);\r
-}\r
-\r
-vec4 __constructor (const bool b) {\r
- return vec4 (b ? 1.0 : 0.0);\r
-}\r
-\r
-ivec2 __constructor (const int i) {\r
- return ivec2 (i, i);\r
-}\r
-\r
-ivec2 __constructor (const float f) {\r
- return ivec2 (int (f));\r
-}\r
-\r
-ivec2 __constructor (const bool b) {\r
- return ivec2 (int (b));\r
-}\r
-\r
-ivec3 __constructor (const int i) {\r
- return ivec3 (i, i, i);\r
-}\r
-\r
-ivec3 __constructor (const float f) {\r
- return ivec3 (int (f));\r
-}\r
-\r
-ivec3 __constructor (const bool b) {\r
- return ivec3 (int (b));\r
-}\r
-\r
-ivec4 __constructor (const int i) {\r
- return ivec4 (i, i, i, i);\r
-}\r
-\r
-ivec4 __constructor (const float f) {\r
- return ivec4 (int (f));\r
-}\r
-\r
-ivec4 __constructor (const bool b) {\r
- return ivec4 (int (b));\r
-}\r
-\r
-bvec2 __constructor (const bool b) {\r
- return bvec2 (b, b);\r
-}\r
-\r
-bvec2 __constructor (const float f) {\r
- return bvec2 (bool (f));\r
-}\r
-\r
-bvec2 __constructor (const int i) {\r
- return bvec2 (bool (i));\r
-}\r
-\r
-bvec3 __constructor (const bool b) {\r
- return bvec3 (b, b, b);\r
-}\r
-\r
-bvec3 __constructor (const float f) {\r
- return bvec3 (bool (f));\r
-}\r
-\r
-bvec3 __constructor (const int i) {\r
- return bvec3 (bool (i));\r
-}\r
-\r
-bvec4 __constructor (const bool b) {\r
- return bvec4 (b, b, b, b);\r
-}\r
-\r
-bvec4 __constructor (const float f) {\r
- return bvec4 (bool (f));\r
-}\r
-\r
-bvec4 __constructor (const int i) {\r
- return bvec4 (bool (i));\r
-}\r
-\r
-mat2 __constructor (const float f) {\r
- return mat2 (f, 0.0, 0.0, f);\r
-}\r
-\r
-mat2 __constructor (const int i) {\r
- float x;\r
- __asm int_to_float x, i;\r
- return mat2 (x);\r
-}\r
-\r
-mat2 __constructor (const bool b) {\r
- return mat2 (b ? 1.0 : 0.0);\r
-}\r
-\r
-mat3 __constructor (const float f) {\r
- return mat3 (f, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, f);\r
-}\r
-\r
-mat3 __constructor (const int i) {\r
- float x;\r
- __asm int_to_float x, i;\r
- return mat3 (x);\r
-}\r
-\r
-mat3 __constructor (const bool b) {\r
- return mat3 (b ? 1.0 : 0.0);\r
-}\r
-\r
-mat4 __constructor (const float f) {\r
- return mat4 (f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f);\r
-}\r
-\r
-mat4 __constructor (const int i) {\r
- float x;\r
- __asm int_to_float x, i;\r
- return mat4 (x);\r
-}\r
-\r
-mat4 __constructor (const bool b) {\r
- return mat4 (b ? 1.0 : 0.0);\r
-}\r
-\r
-void __operator += (inout float a, const float b) {\r
- __asm float_add a, a, b;\r
-}\r
-\r
-float __operator - (const float a) {\r
- float b;\r
- __asm float_negate b, a;\r
- return b;\r
-}\r
-\r
-void __operator -= (inout float a, const float b) {\r
- float c;\r
- __asm float_negate c, b;\r
- __asm float_add a, a, c;\r
-}\r
-\r
-void __operator *= (inout float a, const float b) {\r
- __asm float_multiply a, a, b;\r
-}\r
-\r
-void __operator /= (inout float a, const float b) {\r
- __asm float_divide a, a, b;\r
-}\r
-\r
-float __operator + (const float a, const float b) {\r
- float c;\r
- __asm float_add c, a, b;\r
- return c;\r
-}\r
-\r
-void __operator += (inout int a, const int b) {\r
- a = int (float (a) + float (b));\r
-}\r
-\r
-int __operator - (const int a) {\r
- float x;\r
- int b;\r
- __asm int_to_float x, a;\r
- __asm float_negate x, x;\r
- __asm float_to_int b, x;\r
- return b;\r
-}\r
-\r
-void __operator -= (inout int a, const int b) {\r
- a += -b;\r
-}\r
-\r
-float __operator * (const float a, const float b) {\r
- float c;\r
- __asm float_multiply c, a, b;\r
- return c;\r
-}\r
-\r
-void __operator *= (inout int a, const int b) {\r
- a = int (float (a) * float (b));\r
-}\r
-\r
-float __operator / (const float a, const float b) {\r
- float c;\r
- __asm float_divide c, a, b;\r
- return c;\r
-}\r
-\r
-void __operator /= (inout int a, const int b) {\r
- a = int (float (a) / float (b));\r
-}\r
-\r
-void __operator += (inout vec2 v, const vec2 u) {\r
- v.x += u.x;\r
- v.y += u.y;\r
-}\r
-\r
-void __operator -= (inout vec2 v, const vec2 u) {\r
- v.x -= u.x;\r
- v.y -= u.y;\r
-}\r
-\r
-void __operator *= (inout vec2 v, const vec2 u) {\r
- v.x *= u.x;\r
- v.y *= u.y;\r
-}\r
-\r
-void __operator /= (inout vec2 v, const vec2 u) {\r
- v.x /= u.x;\r
- v.y /= u.y;\r
-}\r
-\r
-void __operator += (inout vec3 v, const vec3 u) {\r
- v.x += u.x;\r
- v.y += u.y;\r
- v.z += u.z;\r
-}\r
-\r
-void __operator -= (inout vec3 v, const vec3 u) {\r
- v.x -= u.x;\r
- v.y -= u.y;\r
- v.z -= u.z;\r
-}\r
-\r
-void __operator *= (inout vec3 v, const vec3 u) {\r
- v.x *= u.x;\r
- v.y *= u.y;\r
- v.z *= u.z;\r
-}\r
-\r
-void __operator /= (inout vec3 v, const vec3 u) {\r
- v.x /= u.x;\r
- v.y /= u.y;\r
- v.z /= u.z;\r
-}\r
-\r
-void __operator += (inout vec4 v, const vec4 u) {\r
- v.x += u.x;\r
- v.y += u.y;\r
- v.z += u.z;\r
- v.w += u.w;\r
-}\r
-\r
-void __operator -= (inout vec4 v, const vec4 u) {\r
- v.x -= u.x;\r
- v.y -= u.y;\r
- v.z -= u.z;\r
- v.w -= u.w;\r
-}\r
-\r
-void __operator *= (inout vec4 v, const vec4 u) {\r
- v.x *= u.x;\r
- v.y *= u.y;\r
- v.z *= u.z;\r
- v.w *= u.w;\r
-}\r
-\r
-void __operator /= (inout vec4 v, const vec4 u) {\r
- v.x /= u.x;\r
- v.y /= u.y;\r
- v.z /= u.z;\r
- v.w /= u.w;\r
-}\r
-\r
-void __operator += (inout ivec2 v, const ivec2 u) {\r
- v.x += u.x;\r
- v.y += u.y;\r
-}\r
-\r
-void __operator -= (inout ivec2 v, const ivec2 u) {\r
- v.x -= u.x;\r
- v.y -= u.y;\r
-}\r
-\r
-void __operator *= (inout ivec2 v, const ivec2 u) {\r
- v.x *= u.x;\r
- v.y *= u.y;\r
-}\r
-\r
-void __operator /= (inout ivec2 v, const ivec2 u) {\r
- v.x /= u.x;\r
- v.y /= u.y;\r
-}\r
-\r
-void __operator += (inout ivec3 v, const ivec3 u) {\r
- v.x += u.x;\r
- v.y += u.y;\r
- v.z += u.z;\r
-}\r
-\r
-void __operator -= (inout ivec3 v, const ivec3 u) {\r
- v.x -= u.x;\r
- v.y -= u.y;\r
- v.z -= u.z;\r
-}\r
-\r
-void __operator *= (inout ivec3 v, const ivec3 u) {\r
- v.x *= u.x;\r
- v.y *= u.y;\r
- v.z *= u.z;\r
-}\r
-\r
-void __operator /= (inout ivec3 v, const ivec3 u) {\r
- v.x /= u.x;\r
- v.y /= u.y;\r
- v.z /= u.z;\r
-}\r
-\r
-void __operator += (inout ivec4 v, const ivec4 u) {\r
- v.x += u.x;\r
- v.y += u.y;\r
- v.z += u.z;\r
- v.w += u.w;\r
-}\r
-\r
-void __operator -= (inout ivec4 v, const ivec4 u) {\r
- v.x -= u.x;\r
- v.y -= u.y;\r
- v.z -= u.z;\r
- v.w -= u.w;\r
-}\r
-\r
-void __operator *= (inout ivec4 v, const ivec4 u) {\r
- v.x *= u.x;\r
- v.y *= u.y;\r
- v.z *= u.z;\r
- v.w *= u.w;\r
-}\r
-\r
-void __operator /= (inout ivec4 v, const ivec4 u) {\r
- v.x /= u.x;\r
- v.y /= u.y;\r
- v.z /= u.z;\r
- v.w /= u.w;\r
-}\r
-\r
-void __operator += (inout mat2 m, const mat2 n) {\r
- m[0] += n[0];\r
- m[1] += n[1];\r
-}\r
-\r
-void __operator -= (inout mat2 m, const mat2 n) {\r
- m[0] -= n[0];\r
- m[1] -= n[1];\r
-}\r
-\r
-vec2 __operator * (const mat2 m, const vec2 v) {\r
- return vec2 (\r
- v.x * m[0].x + v.y * m[1].x,\r
- v.x * m[0].y + v.y * m[1].y\r
- );\r
-}\r
-\r
-mat2 __operator * (const mat2 m, const mat2 n) {\r
- return mat2 (m * n[0], m * n[1]);\r
-}\r
-\r
-void __operator *= (inout mat2 m, const mat2 n) {\r
- m = m * n;\r
-}\r
-\r
-void __operator /= (inout mat2 m, const mat2 n) {\r
- m[0] /= n[0];\r
- m[1] /= n[1];\r
-}\r
-\r
-void __operator += (inout mat3 m, const mat3 n) {\r
- m[0] += n[0];\r
- m[1] += n[1];\r
- m[2] += n[2];\r
-}\r
-\r
-void __operator -= (inout mat3 m, const mat3 n) {\r
- m[0] -= n[0];\r
- m[1] -= n[1];\r
- m[2] -= n[2];\r
-}\r
-\r
-vec3 __operator * (const mat3 m, const vec3 v) {\r
- return vec3 (\r
- v.x * m[0].x + v.y * m[1].x + v.z * m[2].x,\r
- v.x * m[0].y + v.y * m[1].y + v.z * m[2].y,\r
- v.x * m[0].z + v.y * m[1].z + v.z * m[2].z\r
- );\r
-}\r
-\r
-mat3 __operator * (const mat3 m, const mat3 n) {\r
- return mat3 (m * n[0], m * n[1], m * n[2]);\r
-}\r
-\r
-void __operator *= (inout mat3 m, const mat3 n) {\r
- m = m * n;\r
-}\r
-\r
-void __operator /= (inout mat3 m, const mat3 n) {\r
- m[0] /= n[0];\r
- m[1] /= n[1];\r
- m[2] /= n[2];\r
-}\r
-\r
-void __operator += (inout mat4 m, const mat4 n) {\r
- m[0] += n[0];\r
- m[1] += n[1];\r
- m[2] += n[2];\r
- m[3] += n[3];\r
-}\r
-\r
-void __operator -= (inout mat4 m, const mat4 n) {\r
- m[0] -= n[0];\r
- m[1] -= n[1];\r
- m[2] -= n[2];\r
- m[3] -= n[3];\r
-}\r
-\r
-vec4 __operator * (const mat4 m, const vec4 v) {\r
- return vec4 (\r
- v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x,\r
- v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y,\r
- v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z,\r
- v.x * m[0].w + v.y * m[1].w + v.z * m[2].w + v.w * m[3].w\r
- );\r
-}\r
-\r
-mat4 __operator * (const mat4 m, const mat4 n) {\r
- return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]);\r
-}\r
-\r
-void __operator *= (inout mat4 m, const mat4 n) {\r
- m = m * n;\r
-}\r
-\r
-void __operator /= (inout mat4 m, const mat4 n) {\r
- m[0] /= n[0];\r
- m[1] /= n[1];\r
- m[2] /= n[2];\r
- m[3] /= n[3];\r
-}\r
-\r
-void __operator += (inout vec2 v, const float a) {\r
- v.x += a;\r
- v.y += a;\r
-}\r
-\r
-void __operator -= (inout vec2 v, const float a) {\r
- v.x -= a;\r
- v.y -= a;\r
-}\r
-\r
-void __operator *= (inout vec2 v, const float a) {\r
- v.x *= a;\r
- v.y *= a;\r
-}\r
-\r
-void __operator /= (inout vec2 v, const float a) {\r
- v.x /= a;\r
- v.y /= a;\r
-}\r
-\r
-void __operator += (inout vec3 v, const float a) {\r
- v.x += a;\r
- v.y += a;\r
- v.z += a;\r
-}\r
-\r
-void __operator -= (inout vec3 v, const float a) {\r
- v.x -= a;\r
- v.y -= a;\r
- v.z -= a;\r
-}\r
-\r
-void __operator *= (inout vec3 v, const float a) {\r
- v.x *= a;\r
- v.y *= a;\r
- v.z *= a;\r
-}\r
-\r
-void __operator /= (inout vec3 v, const float a) {\r
- v.x /= a;\r
- v.y /= a;\r
- v.z /= a;\r
-}\r
-\r
-void __operator += (inout vec4 v, const float a) {\r
- v.x += a;\r
- v.y += a;\r
- v.z += a;\r
- v.w += a;\r
-}\r
-\r
-void __operator -= (inout vec4 v, const float a) {\r
- v.x -= a;\r
- v.y -= a;\r
- v.z -= a;\r
- v.w -= a;\r
-}\r
-\r
-void __operator *= (inout vec4 v, const float a) {\r
- v.x *= a;\r
- v.y *= a;\r
- v.z *= a;\r
- v.w *= a;\r
-}\r
-\r
-void __operator /= (inout vec4 v, const float a) {\r
- v.x /= a;\r
- v.y /= a;\r
- v.z /= a;\r
- v.w /= a;\r
-}\r
-\r
-void __operator += (inout mat2 m, const float a) {\r
- m[0] += a;\r
- m[1] += a;\r
-}\r
-\r
-void __operator -= (inout mat2 m, const float a) {\r
- m[0] -= a;\r
- m[1] -= a;\r
-}\r
-\r
-void __operator *= (inout mat2 m, const float a) {\r
- m[0] *= a;\r
- m[1] *= a;\r
-}\r
-\r
-void __operator /= (inout mat2 m, const float a) {\r
- m[0] /= a;\r
- m[1] /= a;\r
-}\r
-\r
-void __operator += (inout mat3 m, const float a) {\r
- m[0] += a;\r
- m[1] += a;\r
- m[2] += a;\r
-}\r
-\r
-void __operator -= (inout mat3 m, const float a) {\r
- m[0] -= a;\r
- m[1] -= a;\r
- m[2] -= a;\r
-}\r
-\r
-void __operator *= (inout mat3 m, const float a) {\r
- m[0] *= a;\r
- m[1] *= a;\r
- m[2] *= a;\r
-}\r
-\r
-void __operator /= (inout mat3 m, const float a) {\r
- m[0] /= a;\r
- m[1] /= a;\r
- m[2] /= a;\r
-}\r
-\r
-void __operator += (inout mat4 m, const float a) {\r
- m[0] += a;\r
- m[1] += a;\r
- m[2] += a;\r
- m[3] += a;\r
-}\r
-\r
-void __operator -= (inout mat4 m, const float a) {\r
- m[0] -= a;\r
- m[1] -= a;\r
- m[2] -= a;\r
- m[3] -= a;\r
-}\r
-\r
-void __operator *= (inout mat4 m, const float a) {\r
- m[0] *= a;\r
- m[1] *= a;\r
- m[2] *= a;\r
- m[3] *= a;\r
-}\r
-\r
-void __operator /= (inout mat4 m, const float a) {\r
- m[0] /= a;\r
- m[1] /= a;\r
- m[2] /= a;\r
- m[3] /= a;\r
-}\r
-\r
-vec2 __operator * (const vec2 v, const mat2 m) {\r
- return vec2 (\r
- v.x * m[0].x + v.y * m[0].y,\r
- v.x * m[1].x + v.y * m[1].y\r
- );\r
-}\r
-\r
-void __operator *= (inout vec2 v, const mat2 m) {\r
- v = v * m;\r
-}\r
-\r
-vec3 __operator * (const vec3 v, const mat3 m) {\r
- return vec3 (\r
- v.x * m[0].x + v.y * m[0].y + v.z * m[0].z,\r
- v.x * m[1].x + v.y * m[1].y + v.z * m[1].z,\r
- v.x * m[2].x + v.y * m[2].y + v.z * m[2].z\r
- );\r
-}\r
-\r
-void __operator *= (inout vec3 v, const mat3 m) {\r
- v = v * m;\r
-}\r
-\r
-vec4 __operator * (const vec4 v, const mat4 m) {\r
- return vec4 (\r
- v.x * m[0].x + v.y * m[0].y + v.z * m[0].z + v.w * m[0].w,\r
- v.x * m[1].x + v.y * m[1].y + v.z * m[1].z + v.w * m[1].w,\r
- v.x * m[2].x + v.y * m[2].y + v.z * m[2].z + v.w * m[2].w,\r
- v.x * m[3].x + v.y * m[3].y + v.z * m[3].z + v.w * m[3].w\r
- );\r
-}\r
-\r
-void __operator *= (inout vec4 v, const mat4 m) {\r
- v = v * m;\r
-}\r
-\r
-float __operator - (const float a, const float b) {\r
- float c;\r
- __asm float_negate c, b;\r
- __asm float_add c, a, c;\r
- return c;\r
-}\r
-\r
-int __operator + (const int a, const int b) {\r
- float x, y;\r
- int c;\r
- __asm int_to_float x, a;\r
- __asm int_to_float y, b;\r
- __asm float_add x, x, y;\r
- __asm float_to_int c, x;\r
- return c;\r
-}\r
-\r
-int __operator - (const int a, const int b) {\r
- float x, y;\r
- int c;\r
- __asm int_to_float x, a;\r
- __asm int_to_float y, b;\r
- __asm float_negate y, y;\r
- __asm float_add x, x, y;\r
- __asm float_to_int c, x;\r
- return c;\r
-}\r
-\r
-int __operator * (const int a, const int b) {\r
- float x, y;\r
- int c;\r
- __asm int_to_float x, a;\r
- __asm int_to_float y, b;\r
- __asm float_multiply x, x, y;\r
- __asm float_to_int c, x;\r
- return c;\r
-}\r
-\r
-int __operator / (const int a, const int b) {\r
- float x, y;\r
- int c;\r
- __asm int_to_float x, a;\r
- __asm int_to_float y, b;\r
- __asm float_divide x, x, y;\r
- __asm float_to_int c, x;\r
- return c;\r
-}\r
-\r
-vec2 __operator + (const vec2 v, const vec2 u) {\r
- return vec2 (v.x + u.x, v.y + u.y);\r
-}\r
-\r
-vec2 __operator - (const vec2 v, const vec2 u) {\r
- return vec2 (v.x - u.x, v.y - u.y);\r
-}\r
-\r
-vec2 __operator * (const vec2 v, const vec2 u) {\r
- return vec2 (v.x * u.x, v.y * u.y);\r
-}\r
-\r
-vec2 __operator / (const vec2 v, const vec2 u) {\r
- return vec2 (v.x / u.x, v.y / u.y);\r
-}\r
-\r
-vec3 __operator + (const vec3 v, const vec3 u) {\r
- return vec3 (v.x + u.x, v.y + u.y, v.z + u.z);\r
-}\r
-\r
-vec3 __operator - (const vec3 v, const vec3 u) {\r
- return vec3 (v.x - u.x, v.y - u.y, v.z - u.z);\r
-}\r
-\r
-vec3 __operator * (const vec3 v, const vec3 u) {\r
- return vec3 (v.x * u.x, v.y * u.y, v.z * u.z);\r
-}\r
-\r
-vec3 __operator / (const vec3 v, const vec3 u) {\r
- return vec3 (v.x / u.x, v.y / u.y, v.z / u.z);\r
-}\r
-\r
-vec4 __operator + (const vec4 v, const vec4 u) {\r
- return vec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);\r
-}\r
-\r
-vec4 __operator - (const vec4 v, const vec4 u) {\r
- return vec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);\r
-}\r
-\r
-vec4 __operator * (const vec4 v, const vec4 u) {\r
- return vec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);\r
-}\r
-\r
-vec4 __operator / (const vec4 v, const vec4 u) {\r
- return vec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);\r
-}\r
-\r
-ivec2 __operator + (const ivec2 v, const ivec2 u) {\r
- return ivec2 (v.x + u.x, v.y + u.y);\r
-}\r
-\r
-ivec2 __operator - (const ivec2 v, const ivec2 u) {\r
- return ivec2 (v.x - u.x, v.y - u.y);\r
-}\r
-\r
-ivec2 __operator * (const ivec2 v, const ivec2 u) {\r
- return ivec2 (v.x * u.x, v.y * u.y);\r
-}\r
-\r
-ivec2 __operator / (const ivec2 v, const ivec2 u) {\r
- return ivec2 (v.x / u.x, v.y / u.y);\r
-}\r
-\r
-ivec3 __operator + (const ivec3 v, const ivec3 u) {\r
- return ivec3 (v.x + u.x, v.y + u.y, v.z + u.z);\r
-}\r
-\r
-ivec3 __operator - (const ivec3 v, const ivec3 u) {\r
- return ivec3 (v.x - u.x, v.y - u.y, v.z - u.z);\r
-}\r
-\r
-ivec3 __operator * (const ivec3 v, const ivec3 u) {\r
- return ivec3 (v.x * u.x, v.y * u.y, v.z * u.z);\r
-}\r
-\r
-ivec3 __operator / (const ivec3 v, const ivec3 u) {\r
- return ivec3 (v.x / u.x, v.y / u.y, v.z / u.z);\r
-}\r
-\r
-ivec4 __operator + (const ivec4 v, const ivec4 u) {\r
- return ivec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);\r
-}\r
-\r
-ivec4 __operator - (const ivec4 v, const ivec4 u) {\r
- return ivec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);\r
-}\r
-\r
-ivec4 __operator * (const ivec4 v, const ivec4 u) {\r
- return ivec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);\r
-}\r
-\r
-ivec4 __operator / (const ivec4 v, const ivec4 u) {\r
- return ivec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);\r
-}\r
-\r
-mat2 __operator + (const mat2 m, const mat2 n) {\r
- return mat2 (m[0] + n[0], m[1] + n[1]);\r
-}\r
-\r
-mat2 __operator - (const mat2 m, const mat2 n) {\r
- return mat2 (m[0] - n[0], m[1] - n[1]);\r
-}\r
-\r
-mat2 __operator / (const mat2 m, const mat2 n) {\r
- return mat2 (m[0] / n[0], m[1] / n[1]);\r
-}\r
-\r
-mat3 __operator + (const mat3 m, const mat3 n) {\r
- return mat3 (m[0] + n[0], m[1] + n[1], m[2] + n[2]);\r
-}\r
-\r
-mat3 __operator - (const mat3 m, const mat3 n) {\r
- return mat3 (m[0] - n[0], m[1] - n[1], m[2] - n[2]);\r
-}\r
-\r
-mat3 __operator / (const mat3 m, const mat3 n) {\r
- return mat3 (m[0] / n[0], m[1] / n[1], m[2] / n[2]);\r
-}\r
-\r
-mat4 __operator + (const mat4 m, const mat4 n) {\r
- return mat4 (m[0] + n[0], m[1] + n[1], m[2] + n[2], m[3] + n[3]);\r
-}\r
-\r
-mat4 __operator - (const mat4 m, const mat4 n) {\r
- return mat4 (m[0] - n[0], m[1] - n[1], m[2] - n[2], m[3] - n[3]);\r
-}\r
-\r
-mat4 __operator / (const mat4 m, const mat4 n) {\r
- return mat4 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]);\r
-}\r
-\r
-vec2 __operator + (const float a, const vec2 u) {\r
- return vec2 (a + u.x, a + u.y);\r
-}\r
-\r
-vec2 __operator + (const vec2 v, const float b) {\r
- return vec2 (v.x + b, v.y + b);\r
-}\r
-\r
-vec2 __operator - (const float a, const vec2 u) {\r
- return vec2 (a - u.x, a - u.y);\r
-}\r
-\r
-vec2 __operator - (const vec2 v, const float b) {\r
- return vec2 (v.x - b, v.y - b);\r
-}\r
-\r
-vec2 __operator * (const float a, const vec2 u) {\r
- return vec2 (a * u.x, a * u.y);\r
-}\r
-\r
-vec2 __operator * (const vec2 v, const float b) {\r
- return vec2 (v.x * b, v.y * b);\r
-}\r
-\r
-vec2 __operator / (const float a, const vec2 u) {\r
- return vec2 (a / u.x, a / u.y);\r
-}\r
-\r
-vec2 __operator / (const vec2 v, const float b) {\r
- return vec2 (v.x / b, v.y / b);\r
-}\r
-\r
-vec3 __operator + (const float a, const vec3 u) {\r
- return vec3 (a + u.x, a + u.y, a + u.z);\r
-}\r
-\r
-vec3 __operator + (const vec3 v, const float b) {\r
- return vec3 (v.x + b, v.y + b, v.z + b);\r
-}\r
-\r
-vec3 __operator - (const float a, const vec3 u) {\r
- return vec3 (a - u.x, a - u.y, a - u.z);\r
-}\r
-\r
-vec3 __operator - (const vec3 v, const float b) {\r
- return vec3 (v.x - b, v.y - b, v.z - b);\r
-}\r
-\r
-vec3 __operator * (const float a, const vec3 u) {\r
- return vec3 (a * u.x, a * u.y, a * u.z);\r
-}\r
-\r
-vec3 __operator * (const vec3 v, const float b) {\r
- return vec3 (v.x * b, v.y * b, v.z * b);\r
-}\r
-\r
-vec3 __operator / (const float a, const vec3 u) {\r
- return vec3 (a / u.x, a / u.y, a / u.z);\r
-}\r
-\r
-vec3 __operator / (const vec3 v, const float b) {\r
- return vec3 (v.x / b, v.y / b, v.z / b);\r
-}\r
-\r
-vec4 __operator + (const float a, const vec4 u) {\r
- return vec4 (a + u.x, a + u.y, a + u.z, a + u.w);\r
-}\r
-\r
-vec4 __operator + (const vec4 v, const float b) {\r
- return vec4 (v.x + b, v.y + b, v.z + b, v.w + b);\r
-}\r
-\r
-vec4 __operator - (const float a, const vec4 u) {\r
- return vec4 (a - u.x, a - u.y, a - u.z, a - u.w);\r
-}\r
-\r
-vec4 __operator - (const vec4 v, const float b) {\r
- return vec4 (v.x - b, v.y - b, v.z - b, v.w - b);\r
-}\r
-\r
-vec4 __operator * (const float a, const vec4 u) {\r
- return vec4 (a * u.x, a * u.y, a * u.z, a * u.w);\r
-}\r
-\r
-vec4 __operator * (const vec4 v, const float b) {\r
- return vec4 (v.x * b, v.y * b, v.z * b, v.w * b);\r
-}\r
-\r
-vec4 __operator / (const float a, const vec4 u) {\r
- return vec4 (a / u.x, a / u.y, a / u.z, a / u.w);\r
-}\r
-\r
-vec4 __operator / (const vec4 v, const float b) {\r
- return vec4 (v.x / b, v.y / b, v.z / b, v.w / b);\r
-}\r
-\r
-mat2 __operator + (const float a, const mat2 n) {\r
- return mat2 (a + n[0], a + n[1]);\r
-}\r
-\r
-mat2 __operator + (const mat2 m, const float b) {\r
- return mat2 (m[0] + b, m[1] + b);\r
-}\r
-\r
-mat2 __operator - (const float a, const mat2 n) {\r
- return mat2 (a - n[0], a - n[1]);\r
-}\r
-\r
-mat2 __operator - (const mat2 m, const float b) {\r
- return mat2 (m[0] - b, m[1] - b);\r
-}\r
-\r
-mat2 __operator * (const float a, const mat2 n) {\r
- return mat2 (a * n[0], a * n[1]);\r
-}\r
-\r
-mat2 __operator * (const mat2 m, const float b) {\r
- return mat2 (m[0] * b, m[1] * b);\r
-}\r
-\r
-mat2 __operator / (const float a, const mat2 n) {\r
- return mat2 (a / n[0], a / n[1]);\r
-}\r
-\r
-mat2 __operator / (const mat2 m, const float b) {\r
- return mat2 (m[0] / b, m[1] / b);\r
-}\r
-\r
-mat3 __operator + (const float a, const mat3 n) {\r
- return mat3 (a + n[0], a + n[1], a + n[2]);\r
-}\r
-\r
-mat3 __operator + (const mat3 m, const float b) {\r
- return mat3 (m[0] + b, m[1] + b, m[2] + b);\r
-}\r
-\r
-mat3 __operator - (const float a, const mat3 n) {\r
- return mat3 (a - n[0], a - n[1], a - n[2]);\r
-}\r
-\r
-mat3 __operator - (const mat3 m, const float b) {\r
- return mat3 (m[0] - b, m[1] - b, m[2] - b);\r
-}\r
-\r
-mat3 __operator * (const float a, const mat3 n) {\r
- return mat3 (a * n[0], a * n[1], a * n[2]);\r
-}\r
-\r
-mat3 __operator * (const mat3 m, const float b) {\r
- return mat3 (m[0] * b, m[1] * b, m[2] * b);\r
-}\r
-\r
-mat3 __operator / (const float a, const mat3 n) {\r
- return mat3 (a / n[0], a / n[1], a / n[2]);\r
-}\r
-\r
-mat3 __operator / (const mat3 m, const float b) {\r
- return mat3 (m[0] / b, m[1] / b, m[2] / b);\r
-}\r
-\r
-mat4 __operator + (const float a, const mat4 n) {\r
- return mat4 (a + n[0], a + n[1], a + n[2], a + n[3]);\r
-}\r
-\r
-mat4 __operator + (const mat4 m, const float b) {\r
- return mat4 (m[0] + b, m[1] + b, m[2] + b, m[3] + b);\r
-}\r
-\r
-mat4 __operator - (const float a, const mat4 n) {\r
- return mat4 (a - n[0], a - n[1], a - n[2], a - n[3]);\r
-}\r
-\r
-mat4 __operator - (const mat4 m, const float b) {\r
- return mat4 (m[0] - b, m[1] - b, m[2] - b, m[3] - b);\r
-}\r
-\r
-mat4 __operator * (const float a, const mat4 n) {\r
- return mat4 (a * n[0], a * n[1], a * n[2], a * n[3]);\r
-}\r
-\r
-mat4 __operator * (const mat4 m, const float b) {\r
- return mat4 (m[0] * b, m[1] * b, m[2] * b, m[3] * b);\r
-}\r
-\r
-mat4 __operator / (const float a, const mat4 n) {\r
- return mat4 (a / n[0], a / n[1], a / n[2], a / n[3]);\r
-}\r
-\r
-mat4 __operator / (const mat4 m, const float b) {\r
- return mat4 (m[0] / b, m[1] / b, m[2] / b, m[3] / b);\r
-}\r
-\r
-ivec2 __operator + (const int a, const ivec2 u) {\r
- return ivec2 (a) + u;\r
-}\r
-\r
-ivec2 __operator + (const ivec2 v, const int b) {\r
- return v + ivec2 (b);\r
-}\r
-\r
-ivec2 __operator - (const int a, const ivec2 u) {\r
- return ivec2 (a) - u;\r
-}\r
-\r
-ivec2 __operator - (const ivec2 v, const int b) {\r
- return v - ivec2 (b);\r
-}\r
-\r
-ivec2 __operator * (const int a, const ivec2 u) {\r
- return ivec2 (a) * u;\r
-}\r
-\r
-ivec2 __operator * (const ivec2 v, const int b) {\r
- return v * ivec2 (b);\r
-}\r
-\r
-ivec2 __operator / (const int a, const ivec2 u) {\r
- return ivec2 (a) / u;\r
-}\r
-\r
-ivec2 __operator / (const ivec2 v, const int b) {\r
- return v / ivec2 (b);\r
-}\r
-\r
-ivec3 __operator + (const int a, const ivec3 u) {\r
- return ivec3 (a) + u;\r
-}\r
-\r
-ivec3 __operator + (const ivec3 v, const int b) {\r
- return v + ivec3 (b);\r
-}\r
-\r
-ivec3 __operator - (const int a, const ivec3 u) {\r
- return ivec3 (a) - u;\r
-}\r
-\r
-ivec3 __operator - (const ivec3 v, const int b) {\r
- return v - ivec3 (b);\r
-}\r
-\r
-ivec3 __operator * (const int a, const ivec3 u) {\r
- return ivec3 (a) * u;\r
-}\r
-\r
-ivec3 __operator * (const ivec3 v, const int b) {\r
- return v * ivec3 (b);\r
-}\r
-\r
-ivec3 __operator / (const int a, const ivec3 u) {\r
- return ivec3 (a) / u;\r
-}\r
-\r
-ivec3 __operator / (const ivec3 v, const int b) {\r
- return v / ivec3 (b);\r
-}\r
-\r
-ivec4 __operator + (const int a, const ivec4 u) {\r
- return ivec4 (a) + u;\r
-}\r
-\r
-ivec4 __operator + (const ivec4 v, const int b) {\r
- return v + ivec4 (b);\r
-}\r
-\r
-ivec4 __operator - (const int a, const ivec4 u) {\r
- return ivec4 (a) - u;\r
-}\r
-\r
-ivec4 __operator - (const ivec4 v, const int b) {\r
- return v - ivec4 (b);\r
-}\r
-\r
-ivec4 __operator * (const int a, const ivec4 u) {\r
- return ivec4 (a) * u;\r
-}\r
-\r
-ivec4 __operator * (const ivec4 v, const int b) {\r
- return v * ivec4 (b);\r
-}\r
-\r
-ivec4 __operator / (const int a, const ivec4 u) {\r
- return ivec4 (a) / u;\r
-}\r
-\r
-ivec4 __operator / (const ivec4 v, const int b) {\r
- return v / ivec4 (b);\r
-}\r
-\r
-vec2 __operator - (const vec2 v) {\r
- return vec2 (-v.x, -v.y);\r
-}\r
-\r
-vec3 __operator - (const vec3 v) {\r
- return vec3 (-v.x, -v.y, -v.z);\r
-}\r
-\r
-vec4 __operator - (const vec4 v) {\r
- return vec4 (-v.x, -v.y, -v.z, -v.w);\r
-}\r
-\r
-ivec2 __operator - (const ivec2 v) {\r
- return ivec2 (-v.x, -v.y);\r
-}\r
-\r
-ivec3 __operator - (const ivec3 v) {\r
- return ivec3 (-v.x, -v.y, -v.z);\r
-}\r
-\r
-ivec4 __operator - (const ivec4 v) {\r
- return ivec4 (-v.x, -v.y, -v.z, -v.w);\r
-}\r
-\r
-mat2 __operator - (const mat2 m) {\r
- return mat2 (-m[0], -m[1]);\r
-}\r
-\r
-mat3 __operator - (const mat3 m) {\r
- return mat3 (-m[0], -m[1], -m[2]);\r
-}\r
-\r
-mat4 __operator - (const mat4 m) {\r
- return mat4 (-m[0], -m[1], -m[2], -m[3]);\r
-}\r
-\r
-void __operator -- (inout float a) {\r
- a -= 1.0;\r
-}\r
-\r
-void __operator -- (inout int a) {\r
- a -= 1;\r
-}\r
-\r
-void __operator -- (inout vec2 v) {\r
- --v.x;\r
- --v.y;\r
-}\r
-\r
-void __operator -- (inout vec3 v) {\r
- --v.x;\r
- --v.y;\r
- --v.z;\r
-}\r
-\r
-void __operator -- (inout vec4 v) {\r
- --v.x;\r
- --v.y;\r
- --v.z;\r
- --v.w;\r
-}\r
-\r
-void __operator -- (inout ivec2 v) {\r
- --v.x;\r
- --v.y;\r
-}\r
-\r
-void __operator -- (inout ivec3 v) {\r
- --v.x;\r
- --v.y;\r
- --v.z;\r
-}\r
-\r
-void __operator -- (inout ivec4 v) {\r
- --v.x;\r
- --v.y;\r
- --v.z;\r
- --v.w;\r
-}\r
-\r
-void __operator -- (inout mat2 m) {\r
- --m[0];\r
- --m[1];\r
-}\r
-\r
-void __operator -- (inout mat3 m) {\r
- --m[0];\r
- --m[1];\r
- --m[2];\r
-}\r
-\r
-void __operator -- (inout mat4 m) {\r
- --m[0];\r
- --m[1];\r
- --m[2];\r
- --m[3];\r
-}\r
-\r
-void __operator ++ (inout float a) {\r
- a += 1.0;\r
-}\r
-\r
-void __operator ++ (inout int a) {\r
- a += 1;\r
-}\r
-\r
-void __operator ++ (inout vec2 v) {\r
- ++v.x;\r
- ++v.y;\r
-}\r
-\r
-void __operator ++ (inout vec3 v) {\r
- ++v.x;\r
- ++v.y;\r
- ++v.z;\r
-}\r
-\r
-void __operator ++ (inout vec4 v) {\r
- ++v.x;\r
- ++v.y;\r
- ++v.z;\r
- ++v.w;\r
-}\r
-\r
-void __operator ++ (inout ivec2 v) {\r
- ++v.x;\r
- ++v.y;\r
-}\r
-\r
-void __operator ++ (inout ivec3 v) {\r
- ++v.x;\r
- ++v.y;\r
- ++v.z;\r
-}\r
-\r
-void __operator ++ (inout ivec4 v) {\r
- ++v.x;\r
- ++v.y;\r
- ++v.z;\r
- ++v.w;\r
-}\r
-\r
-void __operator ++ (inout mat2 m) {\r
- ++m[0];\r
- ++m[1];\r
-}\r
-\r
-void __operator ++ (inout mat3 m) {\r
- ++m[0];\r
- ++m[1];\r
- ++m[2];\r
-}\r
-\r
-void __operator ++ (inout mat4 m) {\r
- ++m[0];\r
- ++m[1];\r
- ++m[2];\r
- ++m[3];\r
-}\r
-\r
-//\r
-// NOTE: postfix increment and decrement operators take additional dummy int parameter to\r
-// distinguish their prototypes from prefix ones.\r
-//\r
-\r
-float __operator -- (inout float a, const int) {\r
- float b = a;\r
- --a;\r
- return b;\r
-}\r
-\r
-int __operator -- (inout int a, const int) {\r
- int b = a;\r
- --a;\r
- return b;\r
-}\r
-\r
-vec2 __operator -- (inout vec2 v, const int) {\r
- return vec2 (v.x--, v.y--);\r
-}\r
-\r
-vec3 __operator -- (inout vec3 v, const int) {\r
- return vec3 (v.x--, v.y--, v.z--);\r
-}\r
-\r
-vec4 __operator -- (inout vec4 v, const int) {\r
- return vec4 (v.x--, v.y--, v.z--, v.w--);\r
-}\r
-\r
-ivec2 __operator -- (inout ivec2 v, const int) {\r
- return ivec2 (v.x--, v.y--);\r
-}\r
-\r
-ivec3 __operator -- (inout ivec3 v, const int) {\r
- return ivec3 (v.x--, v.y--, v.z--);\r
-}\r
-\r
-ivec4 __operator -- (inout ivec4 v, const int) {\r
- return ivec4 (v.x--, v.y--, v.z--, v.w--);\r
-}\r
-\r
-mat2 __operator -- (inout mat2 m, const int) {\r
- return mat2 (m[0]--, m[1]--);\r
-}\r
-\r
-mat3 __operator -- (inout mat3 m, const int) {\r
- return mat3 (m[0]--, m[1]--, m[2]--);\r
-}\r
-\r
-mat4 __operator -- (inout mat4 m, const int) {\r
- return mat4 (m[0]--, m[1]--, m[2]--, m[3]--);\r
-}\r
-\r
-float __operator ++ (inout float a, const int) {\r
- float b = a;\r
- ++a;\r
- return b;\r
-}\r
-\r
-int __operator ++ (inout int a, const int) {\r
- int b = a;\r
- ++a;\r
- return b;\r
-}\r
-\r
-vec2 __operator ++ (inout vec2 v, const int) {\r
- return vec2 (v.x++, v.y++);\r
-}\r
-\r
-vec3 __operator ++ (inout vec3 v, const int) {\r
- return vec3 (v.x++, v.y++, v.z++);\r
-}\r
-\r
-vec4 __operator ++ (inout vec4 v, const int) {\r
- return vec4 (v.x++, v.y++, v.z++, v.w++);\r
-}\r
-\r
-ivec2 __operator ++ (inout ivec2 v, const int) {\r
- return ivec2 (v.x++, v.y++);\r
-}\r
-\r
-ivec3 __operator ++ (inout ivec3 v, const int) {\r
- return ivec3 (v.x++, v.y++, v.z++);\r
-}\r
-\r
-ivec4 __operator ++ (inout ivec4 v, const int) {\r
- return ivec4 (v.x++, v.y++, v.z++, v.w++);\r
-}\r
-\r
-mat2 __operator ++ (inout mat2 m, const int) {\r
- return mat2 (m[0]++, m[1]++);\r
-}\r
-\r
-mat3 __operator ++ (inout mat3 m, const int) {\r
- return mat3 (m[0]++, m[1]++, m[2]++);\r
-}\r
-\r
-mat4 __operator ++ (inout mat4 m, const int) {\r
- return mat4 (m[0]++, m[1]++, m[2]++, m[3]++);\r
-}\r
-\r
-bool __operator < (const float a, const float b) {\r
- bool c;\r
- __asm float_less c, a, b;\r
- return c;\r
-}\r
-\r
-bool __operator < (const int a, const int b) {\r
- return float (a) < float (b);\r
-}\r
-\r
-bool __operator > (const float a, const float b) {\r
- bool c;\r
- __asm float_less c, b, a;\r
- return c;\r
-}\r
-\r
-bool __operator > (const int a, const int b) {\r
- return float (a) > float (b);\r
-}\r
-\r
-bool __operator >= (const float a, const float b) {\r
- bool g, e;\r
- __asm float_less g, b, a;\r
- __asm float_equal e, a, b;\r
- return g || e;\r
-}\r
-\r
-bool __operator >= (const int a, const int b) {\r
- return float (a) >= float (b);\r
-}\r
-\r
-bool __operator <= (const float a, const float b) {\r
- bool g, e;\r
- __asm float_less g, a, b;\r
- __asm float_equal e, a, b;\r
- return g || e;\r
-}\r
-\r
-bool __operator <= (const int a, const int b) {\r
- return float (a) <= float (b);\r
-}\r
-\r
-bool __operator ^^ (const bool a, const bool b) {\r
- return a != b;\r
-}\r
-\r
-//\r
-// These operators are handled internally by the compiler:\r
-//\r
-// bool __operator && (bool a, bool b) {\r
-// return a ? b : false;\r
-// }\r
-// bool __operator || (bool a, bool b) {\r
-// return a ? true : b;\r
-// }\r
-//\r
-\r
-bool __operator ! (const bool a) {\r
- return a == false;\r
-}\r
-\r
-//\r
-// mesa-specific extension functions.\r
-//\r
-\r
-void print (const float f) {\r
- __asm float_print f;\r
-}\r
-\r
-void print (const int i) {\r
- __asm int_print i;\r
-}\r
-\r
-void print (const bool b) {\r
- __asm bool_print b;\r
-}\r
-\r
-void print (const vec2 v) {\r
- print (v.x);\r
- print (v.y);\r
-}\r
-\r
-void print (const vec3 v) {\r
- print (v.x);\r
- print (v.y);\r
- print (v.z);\r
-}\r
-\r
-void print (const vec4 v) {\r
- print (v.x);\r
- print (v.y);\r
- print (v.z);\r
- print (v.w);\r
-}\r
-\r
-void print (const ivec2 v) {\r
- print (v.x);\r
- print (v.y);\r
-}\r
-\r
-void print (const ivec3 v) {\r
- print (v.x);\r
- print (v.y);\r
- print (v.z);\r
-}\r
-\r
-void print (const ivec4 v) {\r
- print (v.x);\r
- print (v.y);\r
- print (v.z);\r
- print (v.w);\r
-}\r
-\r
-void print (const bvec2 v) {\r
- print (v.x);\r
- print (v.y);\r
-}\r
-\r
-void print (const bvec3 v) {\r
- print (v.x);\r
- print (v.y);\r
- print (v.z);\r
-}\r
-\r
-void print (const bvec4 v) {\r
- print (v.x);\r
- print (v.y);\r
- print (v.z);\r
- print (v.w);\r
-}\r
-\r
-void print (const mat2 m) {\r
- print (m[0]);\r
- print (m[1]);\r
-}\r
-\r
-void print (const mat3 m) {\r
- print (m[0]);\r
- print (m[1]);\r
- print (m[2]);\r
-}\r
-\r
-void print (const mat4 m) {\r
- print (m[0]);\r
- print (m[1]);\r
- print (m[2]);\r
- print (m[3]);\r
-}\r
-\r
-void print (const sampler1D e) {\r
- __asm int_print e;\r
-}\r
-\r
-void print (const sampler2D e) {\r
- __asm int_print e;\r
-}\r
-\r
-void print (const sampler3D e) {\r
- __asm int_print e;\r
-}\r
-\r
-void print (const samplerCube e) {\r
- __asm int_print e;\r
-}\r
-\r
-void print (const sampler1DShadow e) {\r
- __asm int_print e;\r
-}\r
-\r
-void print (const sampler2DShadow e) {\r
- __asm int_print e;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+//
+// This file defines nearly all constructors and operators for built-in data types, using
+// extended language syntax. In general, compiler treats constructors and operators as
+// ordinary functions with some exceptions. For example, the language does not allow
+// functions to be called in constant expressions - here the exception is made to allow it.
+//
+// Each implementation provides its own version of this file. Each implementation can define
+// the required set of operators and constructors in its own fashion.
+//
+// The extended language syntax is only present when compiling this file. It is implicitly
+// included at the very beginning of the compiled shader, so no built-in functions can be
+// used.
+//
+// To communicate with the implementation, a special extended "__asm" keyword is used, followed
+// by an instruction name (any valid identifier), a destination variable identifier and a
+// a list of zero or more source variable identifiers. A variable identifier is a variable name
+// declared earlier in the code (as a function parameter, local or global variable).
+// An instruction name designates an instruction that must be exported by the implementation.
+// Each instruction receives data from source variable identifiers and returns data in the
+// destination variable identifier.
+//
+// It is up to the implementation how to define a particular operator or constructor. If it is
+// expected to being used rarely, it can be defined in terms of other operators and constructors,
+// for example:
+//
+// ivec2 __operator + (const ivec2 x, const ivec2 y) {
+// return ivec2 (x[0] + y[0], x[1] + y[1]);
+// }
+//
+// If a particular operator or constructor is expected to be used very often or is an atomic
+// operation (that is, an operation that cannot be expressed in terms of other operations or
+// would create a dependency cycle) it must be defined using one or more __asm constructs.
+//
+// Each implementation must define constructors for all scalar types (bool, float, int).
+// There are 9 scalar-to-scalar constructors (including identity constructors). However,
+// since the language introduces special constructors (like matrix constructor with a single
+// scalar value), implementations must also implement these cases.
+// The compiler provides the following algorithm when resolving a constructor:
+// - try to find a constructor with a prototype matching ours,
+// - if no constructor is found and this is a scalar-to-scalar constructor, raise an error,
+// - if a constructor is found, execute it and return,
+// - count the size of the constructor parameter list - if it is less than the size of
+// our constructor's type, raise an error,
+// - for each parameter in the list do a recursive constructor matching for appropriate
+// scalar fields in the constructed variable,
+//
+// Each implementation must also define a set of operators that deal with built-in data types.
+// There are four kinds of operators:
+// 1) Operators that are implemented only by the compiler: "()" (function call), "," (sequence)
+// and "?:" (selection).
+// 2) Operators that are implemented by the compiler by expressing it in terms of other operators:
+// - "." (field selection) - translated to subscript access,
+// - "&&" (logical and) - translated to "<left_expr> ? <right_expr> : false",
+// - "||" (logical or) - translated to "<left_expr> ? true : <right_expr>",
+// 3) Operators that can be defined by the implementation and if the required prototype is not
+// found, standard behaviour is used:
+// - "==", "!=", "=" (equality, assignment) - compare or assign matching fields one-by-one;
+// note that at least operators for scalar data types must be defined by the implementation
+// to get it work,
+// 4) All other operators not mentioned above. If no required prototype is found, an error is
+// raised. An implementation must follow the language specification to provide all valid
+// operator prototypes.
+//
+
+int __constructor (const float f) {
+ int i;
+ __asm float_to_int i, f;
+ return i;
+}
+
+bool __constructor (const int i) {
+ return i != 0;
+}
+
+bool __constructor (const float f) {
+ return f != 0.0;
+}
+
+int __constructor (const bool b) {
+ return b ? 1 : 0;
+}
+
+float __constructor (const bool b) {
+ return b ? 1.0 : 0.0;
+}
+
+float __constructor (const int i) {
+ float f;
+ __asm int_to_float f, i;
+ return f;
+}
+
+bool __constructor (const bool b) {
+ return b;
+}
+
+int __constructor (const int i) {
+ return i;
+}
+
+float __constructor (const float f) {
+ return f;
+}
+
+vec2 __constructor (const float f) {
+ return vec2 (f, f);
+}
+
+vec2 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return vec2 (x);
+}
+
+vec2 __constructor (const bool b) {
+ return vec2 (b ? 1.0 : 0.0);
+}
+
+vec3 __constructor (const float f) {
+ return vec3 (f, f, f);
+}
+
+vec3 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return vec3 (x);
+}
+
+vec3 __constructor (const bool b) {
+ return vec3 (b ? 1.0 : 0.0);
+}
+
+vec4 __constructor (const float f) {
+ return vec4 (f, f, f, f);
+}
+
+vec4 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return vec4 (x);
+}
+
+vec4 __constructor (const bool b) {
+ return vec4 (b ? 1.0 : 0.0);
+}
+
+ivec2 __constructor (const int i) {
+ return ivec2 (i, i);
+}
+
+ivec2 __constructor (const float f) {
+ return ivec2 (int (f));
+}
+
+ivec2 __constructor (const bool b) {
+ return ivec2 (int (b));
+}
+
+ivec3 __constructor (const int i) {
+ return ivec3 (i, i, i);
+}
+
+ivec3 __constructor (const float f) {
+ return ivec3 (int (f));
+}
+
+ivec3 __constructor (const bool b) {
+ return ivec3 (int (b));
+}
+
+ivec4 __constructor (const int i) {
+ return ivec4 (i, i, i, i);
+}
+
+ivec4 __constructor (const float f) {
+ return ivec4 (int (f));
+}
+
+ivec4 __constructor (const bool b) {
+ return ivec4 (int (b));
+}
+
+bvec2 __constructor (const bool b) {
+ return bvec2 (b, b);
+}
+
+bvec2 __constructor (const float f) {
+ return bvec2 (bool (f));
+}
+
+bvec2 __constructor (const int i) {
+ return bvec2 (bool (i));
+}
+
+bvec3 __constructor (const bool b) {
+ return bvec3 (b, b, b);
+}
+
+bvec3 __constructor (const float f) {
+ return bvec3 (bool (f));
+}
+
+bvec3 __constructor (const int i) {
+ return bvec3 (bool (i));
+}
+
+bvec4 __constructor (const bool b) {
+ return bvec4 (b, b, b, b);
+}
+
+bvec4 __constructor (const float f) {
+ return bvec4 (bool (f));
+}
+
+bvec4 __constructor (const int i) {
+ return bvec4 (bool (i));
+}
+
+mat2 __constructor (const float f) {
+ return mat2 (f, 0.0, 0.0, f);
+}
+
+mat2 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return mat2 (x);
+}
+
+mat2 __constructor (const bool b) {
+ return mat2 (b ? 1.0 : 0.0);
+}
+
+mat3 __constructor (const float f) {
+ return mat3 (f, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, f);
+}
+
+mat3 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return mat3 (x);
+}
+
+mat3 __constructor (const bool b) {
+ return mat3 (b ? 1.0 : 0.0);
+}
+
+mat4 __constructor (const float f) {
+ return mat4 (f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f);
+}
+
+mat4 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return mat4 (x);
+}
+
+mat4 __constructor (const bool b) {
+ return mat4 (b ? 1.0 : 0.0);
+}
+
+void __operator += (inout float a, const float b) {
+ __asm float_add a, a, b;
+}
+
+float __operator - (const float a) {
+ float b;
+ __asm float_negate b, a;
+ return b;
+}
+
+void __operator -= (inout float a, const float b) {
+ float c;
+ __asm float_negate c, b;
+ __asm float_add a, a, c;
+}
+
+void __operator *= (inout float a, const float b) {
+ __asm float_multiply a, a, b;
+}
+
+void __operator /= (inout float a, const float b) {
+ __asm float_divide a, a, b;
+}
+
+float __operator + (const float a, const float b) {
+ float c;
+ __asm float_add c, a, b;
+ return c;
+}
+
+void __operator += (inout int a, const int b) {
+ a = int (float (a) + float (b));
+}
+
+int __operator - (const int a) {
+ float x;
+ int b;
+ __asm int_to_float x, a;
+ __asm float_negate x, x;
+ __asm float_to_int b, x;
+ return b;
+}
+
+void __operator -= (inout int a, const int b) {
+ a += -b;
+}
+
+float __operator * (const float a, const float b) {
+ float c;
+ __asm float_multiply c, a, b;
+ return c;
+}
+
+void __operator *= (inout int a, const int b) {
+ a = int (float (a) * float (b));
+}
+
+float __operator / (const float a, const float b) {
+ float c;
+ __asm float_divide c, a, b;
+ return c;
+}
+
+void __operator /= (inout int a, const int b) {
+ a = int (float (a) / float (b));
+}
+
+void __operator += (inout vec2 v, const vec2 u) {
+ v.x += u.x;
+ v.y += u.y;
+}
+
+void __operator -= (inout vec2 v, const vec2 u) {
+ v.x -= u.x;
+ v.y -= u.y;
+}
+
+void __operator *= (inout vec2 v, const vec2 u) {
+ v.x *= u.x;
+ v.y *= u.y;
+}
+
+void __operator /= (inout vec2 v, const vec2 u) {
+ v.x /= u.x;
+ v.y /= u.y;
+}
+
+void __operator += (inout vec3 v, const vec3 u) {
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
+}
+
+void __operator -= (inout vec3 v, const vec3 u) {
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
+}
+
+void __operator *= (inout vec3 v, const vec3 u) {
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
+}
+
+void __operator /= (inout vec3 v, const vec3 u) {
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
+}
+
+void __operator += (inout vec4 v, const vec4 u) {
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
+ v.w += u.w;
+}
+
+void __operator -= (inout vec4 v, const vec4 u) {
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
+ v.w -= u.w;
+}
+
+void __operator *= (inout vec4 v, const vec4 u) {
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
+ v.w *= u.w;
+}
+
+void __operator /= (inout vec4 v, const vec4 u) {
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
+ v.w /= u.w;
+}
+
+void __operator += (inout ivec2 v, const ivec2 u) {
+ v.x += u.x;
+ v.y += u.y;
+}
+
+void __operator -= (inout ivec2 v, const ivec2 u) {
+ v.x -= u.x;
+ v.y -= u.y;
+}
+
+void __operator *= (inout ivec2 v, const ivec2 u) {
+ v.x *= u.x;
+ v.y *= u.y;
+}
+
+void __operator /= (inout ivec2 v, const ivec2 u) {
+ v.x /= u.x;
+ v.y /= u.y;
+}
+
+void __operator += (inout ivec3 v, const ivec3 u) {
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
+}
+
+void __operator -= (inout ivec3 v, const ivec3 u) {
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
+}
+
+void __operator *= (inout ivec3 v, const ivec3 u) {
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
+}
+
+void __operator /= (inout ivec3 v, const ivec3 u) {
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
+}
+
+void __operator += (inout ivec4 v, const ivec4 u) {
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
+ v.w += u.w;
+}
+
+void __operator -= (inout ivec4 v, const ivec4 u) {
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
+ v.w -= u.w;
+}
+
+void __operator *= (inout ivec4 v, const ivec4 u) {
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
+ v.w *= u.w;
+}
+
+void __operator /= (inout ivec4 v, const ivec4 u) {
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
+ v.w /= u.w;
+}
+
+void __operator += (inout mat2 m, const mat2 n) {
+ m[0] += n[0];
+ m[1] += n[1];
+}
+
+void __operator -= (inout mat2 m, const mat2 n) {
+ m[0] -= n[0];
+ m[1] -= n[1];
+}
+
+vec2 __operator * (const mat2 m, const vec2 v) {
+ return vec2 (
+ v.x * m[0].x + v.y * m[1].x,
+ v.x * m[0].y + v.y * m[1].y
+ );
+}
+
+mat2 __operator * (const mat2 m, const mat2 n) {
+ return mat2 (m * n[0], m * n[1]);
+}
+
+void __operator *= (inout mat2 m, const mat2 n) {
+ m = m * n;
+}
+
+void __operator /= (inout mat2 m, const mat2 n) {
+ m[0] /= n[0];
+ m[1] /= n[1];
+}
+
+void __operator += (inout mat3 m, const mat3 n) {
+ m[0] += n[0];
+ m[1] += n[1];
+ m[2] += n[2];
+}
+
+void __operator -= (inout mat3 m, const mat3 n) {
+ m[0] -= n[0];
+ m[1] -= n[1];
+ m[2] -= n[2];
+}
+
+vec3 __operator * (const mat3 m, const vec3 v) {
+ return vec3 (
+ v.x * m[0].x + v.y * m[1].x + v.z * m[2].x,
+ v.x * m[0].y + v.y * m[1].y + v.z * m[2].y,
+ v.x * m[0].z + v.y * m[1].z + v.z * m[2].z
+ );
+}
+
+mat3 __operator * (const mat3 m, const mat3 n) {
+ return mat3 (m * n[0], m * n[1], m * n[2]);
+}
+
+void __operator *= (inout mat3 m, const mat3 n) {
+ m = m * n;
+}
+
+void __operator /= (inout mat3 m, const mat3 n) {
+ m[0] /= n[0];
+ m[1] /= n[1];
+ m[2] /= n[2];
+}
+
+void __operator += (inout mat4 m, const mat4 n) {
+ m[0] += n[0];
+ m[1] += n[1];
+ m[2] += n[2];
+ m[3] += n[3];
+}
+
+void __operator -= (inout mat4 m, const mat4 n) {
+ m[0] -= n[0];
+ m[1] -= n[1];
+ m[2] -= n[2];
+ m[3] -= n[3];
+}
+
+vec4 __operator * (const mat4 m, const vec4 v) {
+ return vec4 (
+ v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x,
+ v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y,
+ v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z,
+ v.x * m[0].w + v.y * m[1].w + v.z * m[2].w + v.w * m[3].w
+ );
+}
+
+mat4 __operator * (const mat4 m, const mat4 n) {
+ return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]);
+}
+
+void __operator *= (inout mat4 m, const mat4 n) {
+ m = m * n;
+}
+
+void __operator /= (inout mat4 m, const mat4 n) {
+ m[0] /= n[0];
+ m[1] /= n[1];
+ m[2] /= n[2];
+ m[3] /= n[3];
+}
+
+void __operator += (inout vec2 v, const float a) {
+ v.x += a;
+ v.y += a;
+}
+
+void __operator -= (inout vec2 v, const float a) {
+ v.x -= a;
+ v.y -= a;
+}
+
+void __operator *= (inout vec2 v, const float a) {
+ v.x *= a;
+ v.y *= a;
+}
+
+void __operator /= (inout vec2 v, const float a) {
+ v.x /= a;
+ v.y /= a;
+}
+
+void __operator += (inout vec3 v, const float a) {
+ v.x += a;
+ v.y += a;
+ v.z += a;
+}
+
+void __operator -= (inout vec3 v, const float a) {
+ v.x -= a;
+ v.y -= a;
+ v.z -= a;
+}
+
+void __operator *= (inout vec3 v, const float a) {
+ v.x *= a;
+ v.y *= a;
+ v.z *= a;
+}
+
+void __operator /= (inout vec3 v, const float a) {
+ v.x /= a;
+ v.y /= a;
+ v.z /= a;
+}
+
+void __operator += (inout vec4 v, const float a) {
+ v.x += a;
+ v.y += a;
+ v.z += a;
+ v.w += a;
+}
+
+void __operator -= (inout vec4 v, const float a) {
+ v.x -= a;
+ v.y -= a;
+ v.z -= a;
+ v.w -= a;
+}
+
+void __operator *= (inout vec4 v, const float a) {
+ v.x *= a;
+ v.y *= a;
+ v.z *= a;
+ v.w *= a;
+}
+
+void __operator /= (inout vec4 v, const float a) {
+ v.x /= a;
+ v.y /= a;
+ v.z /= a;
+ v.w /= a;
+}
+
+void __operator += (inout mat2 m, const float a) {
+ m[0] += a;
+ m[1] += a;
+}
+
+void __operator -= (inout mat2 m, const float a) {
+ m[0] -= a;
+ m[1] -= a;
+}
+
+void __operator *= (inout mat2 m, const float a) {
+ m[0] *= a;
+ m[1] *= a;
+}
+
+void __operator /= (inout mat2 m, const float a) {
+ m[0] /= a;
+ m[1] /= a;
+}
+
+void __operator += (inout mat3 m, const float a) {
+ m[0] += a;
+ m[1] += a;
+ m[2] += a;
+}
+
+void __operator -= (inout mat3 m, const float a) {
+ m[0] -= a;
+ m[1] -= a;
+ m[2] -= a;
+}
+
+void __operator *= (inout mat3 m, const float a) {
+ m[0] *= a;
+ m[1] *= a;
+ m[2] *= a;
+}
+
+void __operator /= (inout mat3 m, const float a) {
+ m[0] /= a;
+ m[1] /= a;
+ m[2] /= a;
+}
+
+void __operator += (inout mat4 m, const float a) {
+ m[0] += a;
+ m[1] += a;
+ m[2] += a;
+ m[3] += a;
+}
+
+void __operator -= (inout mat4 m, const float a) {
+ m[0] -= a;
+ m[1] -= a;
+ m[2] -= a;
+ m[3] -= a;
+}
+
+void __operator *= (inout mat4 m, const float a) {
+ m[0] *= a;
+ m[1] *= a;
+ m[2] *= a;
+ m[3] *= a;
+}
+
+void __operator /= (inout mat4 m, const float a) {
+ m[0] /= a;
+ m[1] /= a;
+ m[2] /= a;
+ m[3] /= a;
+}
+
+vec2 __operator * (const vec2 v, const mat2 m) {
+ return vec2 (
+ v.x * m[0].x + v.y * m[0].y,
+ v.x * m[1].x + v.y * m[1].y
+ );
+}
+
+void __operator *= (inout vec2 v, const mat2 m) {
+ v = v * m;
+}
+
+vec3 __operator * (const vec3 v, const mat3 m) {
+ return vec3 (
+ v.x * m[0].x + v.y * m[0].y + v.z * m[0].z,
+ v.x * m[1].x + v.y * m[1].y + v.z * m[1].z,
+ v.x * m[2].x + v.y * m[2].y + v.z * m[2].z
+ );
+}
+
+void __operator *= (inout vec3 v, const mat3 m) {
+ v = v * m;
+}
+
+vec4 __operator * (const vec4 v, const mat4 m) {
+ return vec4 (
+ v.x * m[0].x + v.y * m[0].y + v.z * m[0].z + v.w * m[0].w,
+ v.x * m[1].x + v.y * m[1].y + v.z * m[1].z + v.w * m[1].w,
+ v.x * m[2].x + v.y * m[2].y + v.z * m[2].z + v.w * m[2].w,
+ v.x * m[3].x + v.y * m[3].y + v.z * m[3].z + v.w * m[3].w
+ );
+}
+
+void __operator *= (inout vec4 v, const mat4 m) {
+ v = v * m;
+}
+
+float __operator - (const float a, const float b) {
+ float c;
+ __asm float_negate c, b;
+ __asm float_add c, a, c;
+ return c;
+}
+
+int __operator + (const int a, const int b) {
+ float x, y;
+ int c;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_add x, x, y;
+ __asm float_to_int c, x;
+ return c;
+}
+
+int __operator - (const int a, const int b) {
+ float x, y;
+ int c;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_negate y, y;
+ __asm float_add x, x, y;
+ __asm float_to_int c, x;
+ return c;
+}
+
+int __operator * (const int a, const int b) {
+ float x, y;
+ int c;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_multiply x, x, y;
+ __asm float_to_int c, x;
+ return c;
+}
+
+int __operator / (const int a, const int b) {
+ float x, y;
+ int c;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_divide x, x, y;
+ __asm float_to_int c, x;
+ return c;
+}
+
+vec2 __operator + (const vec2 v, const vec2 u) {
+ return vec2 (v.x + u.x, v.y + u.y);
+}
+
+vec2 __operator - (const vec2 v, const vec2 u) {
+ return vec2 (v.x - u.x, v.y - u.y);
+}
+
+vec2 __operator * (const vec2 v, const vec2 u) {
+ return vec2 (v.x * u.x, v.y * u.y);
+}
+
+vec2 __operator / (const vec2 v, const vec2 u) {
+ return vec2 (v.x / u.x, v.y / u.y);
+}
+
+vec3 __operator + (const vec3 v, const vec3 u) {
+ return vec3 (v.x + u.x, v.y + u.y, v.z + u.z);
+}
+
+vec3 __operator - (const vec3 v, const vec3 u) {
+ return vec3 (v.x - u.x, v.y - u.y, v.z - u.z);
+}
+
+vec3 __operator * (const vec3 v, const vec3 u) {
+ return vec3 (v.x * u.x, v.y * u.y, v.z * u.z);
+}
+
+vec3 __operator / (const vec3 v, const vec3 u) {
+ return vec3 (v.x / u.x, v.y / u.y, v.z / u.z);
+}
+
+vec4 __operator + (const vec4 v, const vec4 u) {
+ return vec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
+}
+
+vec4 __operator - (const vec4 v, const vec4 u) {
+ return vec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
+}
+
+vec4 __operator * (const vec4 v, const vec4 u) {
+ return vec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
+}
+
+vec4 __operator / (const vec4 v, const vec4 u) {
+ return vec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
+}
+
+ivec2 __operator + (const ivec2 v, const ivec2 u) {
+ return ivec2 (v.x + u.x, v.y + u.y);
+}
+
+ivec2 __operator - (const ivec2 v, const ivec2 u) {
+ return ivec2 (v.x - u.x, v.y - u.y);
+}
+
+ivec2 __operator * (const ivec2 v, const ivec2 u) {
+ return ivec2 (v.x * u.x, v.y * u.y);
+}
+
+ivec2 __operator / (const ivec2 v, const ivec2 u) {
+ return ivec2 (v.x / u.x, v.y / u.y);
+}
+
+ivec3 __operator + (const ivec3 v, const ivec3 u) {
+ return ivec3 (v.x + u.x, v.y + u.y, v.z + u.z);
+}
+
+ivec3 __operator - (const ivec3 v, const ivec3 u) {
+ return ivec3 (v.x - u.x, v.y - u.y, v.z - u.z);
+}
+
+ivec3 __operator * (const ivec3 v, const ivec3 u) {
+ return ivec3 (v.x * u.x, v.y * u.y, v.z * u.z);
+}
+
+ivec3 __operator / (const ivec3 v, const ivec3 u) {
+ return ivec3 (v.x / u.x, v.y / u.y, v.z / u.z);
+}
+
+ivec4 __operator + (const ivec4 v, const ivec4 u) {
+ return ivec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
+}
+
+ivec4 __operator - (const ivec4 v, const ivec4 u) {
+ return ivec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
+}
+
+ivec4 __operator * (const ivec4 v, const ivec4 u) {
+ return ivec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
+}
+
+ivec4 __operator / (const ivec4 v, const ivec4 u) {
+ return ivec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
+}
+
+mat2 __operator + (const mat2 m, const mat2 n) {
+ return mat2 (m[0] + n[0], m[1] + n[1]);
+}
+
+mat2 __operator - (const mat2 m, const mat2 n) {
+ return mat2 (m[0] - n[0], m[1] - n[1]);
+}
+
+mat2 __operator / (const mat2 m, const mat2 n) {
+ return mat2 (m[0] / n[0], m[1] / n[1]);
+}
+
+mat3 __operator + (const mat3 m, const mat3 n) {
+ return mat3 (m[0] + n[0], m[1] + n[1], m[2] + n[2]);
+}
+
+mat3 __operator - (const mat3 m, const mat3 n) {
+ return mat3 (m[0] - n[0], m[1] - n[1], m[2] - n[2]);
+}
+
+mat3 __operator / (const mat3 m, const mat3 n) {
+ return mat3 (m[0] / n[0], m[1] / n[1], m[2] / n[2]);
+}
+
+mat4 __operator + (const mat4 m, const mat4 n) {
+ return mat4 (m[0] + n[0], m[1] + n[1], m[2] + n[2], m[3] + n[3]);
+}
+
+mat4 __operator - (const mat4 m, const mat4 n) {
+ return mat4 (m[0] - n[0], m[1] - n[1], m[2] - n[2], m[3] - n[3]);
+}
+
+mat4 __operator / (const mat4 m, const mat4 n) {
+ return mat4 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]);
+}
+
+vec2 __operator + (const float a, const vec2 u) {
+ return vec2 (a + u.x, a + u.y);
+}
+
+vec2 __operator + (const vec2 v, const float b) {
+ return vec2 (v.x + b, v.y + b);
+}
+
+vec2 __operator - (const float a, const vec2 u) {
+ return vec2 (a - u.x, a - u.y);
+}
+
+vec2 __operator - (const vec2 v, const float b) {
+ return vec2 (v.x - b, v.y - b);
+}
+
+vec2 __operator * (const float a, const vec2 u) {
+ return vec2 (a * u.x, a * u.y);
+}
+
+vec2 __operator * (const vec2 v, const float b) {
+ return vec2 (v.x * b, v.y * b);
+}
+
+vec2 __operator / (const float a, const vec2 u) {
+ return vec2 (a / u.x, a / u.y);
+}
+
+vec2 __operator / (const vec2 v, const float b) {
+ return vec2 (v.x / b, v.y / b);
+}
+
+vec3 __operator + (const float a, const vec3 u) {
+ return vec3 (a + u.x, a + u.y, a + u.z);
+}
+
+vec3 __operator + (const vec3 v, const float b) {
+ return vec3 (v.x + b, v.y + b, v.z + b);
+}
+
+vec3 __operator - (const float a, const vec3 u) {
+ return vec3 (a - u.x, a - u.y, a - u.z);
+}
+
+vec3 __operator - (const vec3 v, const float b) {
+ return vec3 (v.x - b, v.y - b, v.z - b);
+}
+
+vec3 __operator * (const float a, const vec3 u) {
+ return vec3 (a * u.x, a * u.y, a * u.z);
+}
+
+vec3 __operator * (const vec3 v, const float b) {
+ return vec3 (v.x * b, v.y * b, v.z * b);
+}
+
+vec3 __operator / (const float a, const vec3 u) {
+ return vec3 (a / u.x, a / u.y, a / u.z);
+}
+
+vec3 __operator / (const vec3 v, const float b) {
+ return vec3 (v.x / b, v.y / b, v.z / b);
+}
+
+vec4 __operator + (const float a, const vec4 u) {
+ return vec4 (a + u.x, a + u.y, a + u.z, a + u.w);
+}
+
+vec4 __operator + (const vec4 v, const float b) {
+ return vec4 (v.x + b, v.y + b, v.z + b, v.w + b);
+}
+
+vec4 __operator - (const float a, const vec4 u) {
+ return vec4 (a - u.x, a - u.y, a - u.z, a - u.w);
+}
+
+vec4 __operator - (const vec4 v, const float b) {
+ return vec4 (v.x - b, v.y - b, v.z - b, v.w - b);
+}
+
+vec4 __operator * (const float a, const vec4 u) {
+ return vec4 (a * u.x, a * u.y, a * u.z, a * u.w);
+}
+
+vec4 __operator * (const vec4 v, const float b) {
+ return vec4 (v.x * b, v.y * b, v.z * b, v.w * b);
+}
+
+vec4 __operator / (const float a, const vec4 u) {
+ return vec4 (a / u.x, a / u.y, a / u.z, a / u.w);
+}
+
+vec4 __operator / (const vec4 v, const float b) {
+ return vec4 (v.x / b, v.y / b, v.z / b, v.w / b);
+}
+
+mat2 __operator + (const float a, const mat2 n) {
+ return mat2 (a + n[0], a + n[1]);
+}
+
+mat2 __operator + (const mat2 m, const float b) {
+ return mat2 (m[0] + b, m[1] + b);
+}
+
+mat2 __operator - (const float a, const mat2 n) {
+ return mat2 (a - n[0], a - n[1]);
+}
+
+mat2 __operator - (const mat2 m, const float b) {
+ return mat2 (m[0] - b, m[1] - b);
+}
+
+mat2 __operator * (const float a, const mat2 n) {
+ return mat2 (a * n[0], a * n[1]);
+}
+
+mat2 __operator * (const mat2 m, const float b) {
+ return mat2 (m[0] * b, m[1] * b);
+}
+
+mat2 __operator / (const float a, const mat2 n) {
+ return mat2 (a / n[0], a / n[1]);
+}
+
+mat2 __operator / (const mat2 m, const float b) {
+ return mat2 (m[0] / b, m[1] / b);
+}
+
+mat3 __operator + (const float a, const mat3 n) {
+ return mat3 (a + n[0], a + n[1], a + n[2]);
+}
+
+mat3 __operator + (const mat3 m, const float b) {
+ return mat3 (m[0] + b, m[1] + b, m[2] + b);
+}
+
+mat3 __operator - (const float a, const mat3 n) {
+ return mat3 (a - n[0], a - n[1], a - n[2]);
+}
+
+mat3 __operator - (const mat3 m, const float b) {
+ return mat3 (m[0] - b, m[1] - b, m[2] - b);
+}
+
+mat3 __operator * (const float a, const mat3 n) {
+ return mat3 (a * n[0], a * n[1], a * n[2]);
+}
+
+mat3 __operator * (const mat3 m, const float b) {
+ return mat3 (m[0] * b, m[1] * b, m[2] * b);
+}
+
+mat3 __operator / (const float a, const mat3 n) {
+ return mat3 (a / n[0], a / n[1], a / n[2]);
+}
+
+mat3 __operator / (const mat3 m, const float b) {
+ return mat3 (m[0] / b, m[1] / b, m[2] / b);
+}
+
+mat4 __operator + (const float a, const mat4 n) {
+ return mat4 (a + n[0], a + n[1], a + n[2], a + n[3]);
+}
+
+mat4 __operator + (const mat4 m, const float b) {
+ return mat4 (m[0] + b, m[1] + b, m[2] + b, m[3] + b);
+}
+
+mat4 __operator - (const float a, const mat4 n) {
+ return mat4 (a - n[0], a - n[1], a - n[2], a - n[3]);
+}
+
+mat4 __operator - (const mat4 m, const float b) {
+ return mat4 (m[0] - b, m[1] - b, m[2] - b, m[3] - b);
+}
+
+mat4 __operator * (const float a, const mat4 n) {
+ return mat4 (a * n[0], a * n[1], a * n[2], a * n[3]);
+}
+
+mat4 __operator * (const mat4 m, const float b) {
+ return mat4 (m[0] * b, m[1] * b, m[2] * b, m[3] * b);
+}
+
+mat4 __operator / (const float a, const mat4 n) {
+ return mat4 (a / n[0], a / n[1], a / n[2], a / n[3]);
+}
+
+mat4 __operator / (const mat4 m, const float b) {
+ return mat4 (m[0] / b, m[1] / b, m[2] / b, m[3] / b);
+}
+
+ivec2 __operator + (const int a, const ivec2 u) {
+ return ivec2 (a) + u;
+}
+
+ivec2 __operator + (const ivec2 v, const int b) {
+ return v + ivec2 (b);
+}
+
+ivec2 __operator - (const int a, const ivec2 u) {
+ return ivec2 (a) - u;
+}
+
+ivec2 __operator - (const ivec2 v, const int b) {
+ return v - ivec2 (b);
+}
+
+ivec2 __operator * (const int a, const ivec2 u) {
+ return ivec2 (a) * u;
+}
+
+ivec2 __operator * (const ivec2 v, const int b) {
+ return v * ivec2 (b);
+}
+
+ivec2 __operator / (const int a, const ivec2 u) {
+ return ivec2 (a) / u;
+}
+
+ivec2 __operator / (const ivec2 v, const int b) {
+ return v / ivec2 (b);
+}
+
+ivec3 __operator + (const int a, const ivec3 u) {
+ return ivec3 (a) + u;
+}
+
+ivec3 __operator + (const ivec3 v, const int b) {
+ return v + ivec3 (b);
+}
+
+ivec3 __operator - (const int a, const ivec3 u) {
+ return ivec3 (a) - u;
+}
+
+ivec3 __operator - (const ivec3 v, const int b) {
+ return v - ivec3 (b);
+}
+
+ivec3 __operator * (const int a, const ivec3 u) {
+ return ivec3 (a) * u;
+}
+
+ivec3 __operator * (const ivec3 v, const int b) {
+ return v * ivec3 (b);
+}
+
+ivec3 __operator / (const int a, const ivec3 u) {
+ return ivec3 (a) / u;
+}
+
+ivec3 __operator / (const ivec3 v, const int b) {
+ return v / ivec3 (b);
+}
+
+ivec4 __operator + (const int a, const ivec4 u) {
+ return ivec4 (a) + u;
+}
+
+ivec4 __operator + (const ivec4 v, const int b) {
+ return v + ivec4 (b);
+}
+
+ivec4 __operator - (const int a, const ivec4 u) {
+ return ivec4 (a) - u;
+}
+
+ivec4 __operator - (const ivec4 v, const int b) {
+ return v - ivec4 (b);
+}
+
+ivec4 __operator * (const int a, const ivec4 u) {
+ return ivec4 (a) * u;
+}
+
+ivec4 __operator * (const ivec4 v, const int b) {
+ return v * ivec4 (b);
+}
+
+ivec4 __operator / (const int a, const ivec4 u) {
+ return ivec4 (a) / u;
+}
+
+ivec4 __operator / (const ivec4 v, const int b) {
+ return v / ivec4 (b);
+}
+
+vec2 __operator - (const vec2 v) {
+ return vec2 (-v.x, -v.y);
+}
+
+vec3 __operator - (const vec3 v) {
+ return vec3 (-v.x, -v.y, -v.z);
+}
+
+vec4 __operator - (const vec4 v) {
+ return vec4 (-v.x, -v.y, -v.z, -v.w);
+}
+
+ivec2 __operator - (const ivec2 v) {
+ return ivec2 (-v.x, -v.y);
+}
+
+ivec3 __operator - (const ivec3 v) {
+ return ivec3 (-v.x, -v.y, -v.z);
+}
+
+ivec4 __operator - (const ivec4 v) {
+ return ivec4 (-v.x, -v.y, -v.z, -v.w);
+}
+
+mat2 __operator - (const mat2 m) {
+ return mat2 (-m[0], -m[1]);
+}
+
+mat3 __operator - (const mat3 m) {
+ return mat3 (-m[0], -m[1], -m[2]);
+}
+
+mat4 __operator - (const mat4 m) {
+ return mat4 (-m[0], -m[1], -m[2], -m[3]);
+}
+
+void __operator -- (inout float a) {
+ a -= 1.0;
+}
+
+void __operator -- (inout int a) {
+ a -= 1;
+}
+
+void __operator -- (inout vec2 v) {
+ --v.x;
+ --v.y;
+}
+
+void __operator -- (inout vec3 v) {
+ --v.x;
+ --v.y;
+ --v.z;
+}
+
+void __operator -- (inout vec4 v) {
+ --v.x;
+ --v.y;
+ --v.z;
+ --v.w;
+}
+
+void __operator -- (inout ivec2 v) {
+ --v.x;
+ --v.y;
+}
+
+void __operator -- (inout ivec3 v) {
+ --v.x;
+ --v.y;
+ --v.z;
+}
+
+void __operator -- (inout ivec4 v) {
+ --v.x;
+ --v.y;
+ --v.z;
+ --v.w;
+}
+
+void __operator -- (inout mat2 m) {
+ --m[0];
+ --m[1];
+}
+
+void __operator -- (inout mat3 m) {
+ --m[0];
+ --m[1];
+ --m[2];
+}
+
+void __operator -- (inout mat4 m) {
+ --m[0];
+ --m[1];
+ --m[2];
+ --m[3];
+}
+
+void __operator ++ (inout float a) {
+ a += 1.0;
+}
+
+void __operator ++ (inout int a) {
+ a += 1;
+}
+
+void __operator ++ (inout vec2 v) {
+ ++v.x;
+ ++v.y;
+}
+
+void __operator ++ (inout vec3 v) {
+ ++v.x;
+ ++v.y;
+ ++v.z;
+}
+
+void __operator ++ (inout vec4 v) {
+ ++v.x;
+ ++v.y;
+ ++v.z;
+ ++v.w;
+}
+
+void __operator ++ (inout ivec2 v) {
+ ++v.x;
+ ++v.y;
+}
+
+void __operator ++ (inout ivec3 v) {
+ ++v.x;
+ ++v.y;
+ ++v.z;
+}
+
+void __operator ++ (inout ivec4 v) {
+ ++v.x;
+ ++v.y;
+ ++v.z;
+ ++v.w;
+}
+
+void __operator ++ (inout mat2 m) {
+ ++m[0];
+ ++m[1];
+}
+
+void __operator ++ (inout mat3 m) {
+ ++m[0];
+ ++m[1];
+ ++m[2];
+}
+
+void __operator ++ (inout mat4 m) {
+ ++m[0];
+ ++m[1];
+ ++m[2];
+ ++m[3];
+}
+
+//
+// NOTE: postfix increment and decrement operators take additional dummy int parameter to
+// distinguish their prototypes from prefix ones.
+//
+
+float __operator -- (inout float a, const int) {
+ float b = a;
+ --a;
+ return b;
+}
+
+int __operator -- (inout int a, const int) {
+ int b = a;
+ --a;
+ return b;
+}
+
+vec2 __operator -- (inout vec2 v, const int) {
+ return vec2 (v.x--, v.y--);
+}
+
+vec3 __operator -- (inout vec3 v, const int) {
+ return vec3 (v.x--, v.y--, v.z--);
+}
+
+vec4 __operator -- (inout vec4 v, const int) {
+ return vec4 (v.x--, v.y--, v.z--, v.w--);
+}
+
+ivec2 __operator -- (inout ivec2 v, const int) {
+ return ivec2 (v.x--, v.y--);
+}
+
+ivec3 __operator -- (inout ivec3 v, const int) {
+ return ivec3 (v.x--, v.y--, v.z--);
+}
+
+ivec4 __operator -- (inout ivec4 v, const int) {
+ return ivec4 (v.x--, v.y--, v.z--, v.w--);
+}
+
+mat2 __operator -- (inout mat2 m, const int) {
+ return mat2 (m[0]--, m[1]--);
+}
+
+mat3 __operator -- (inout mat3 m, const int) {
+ return mat3 (m[0]--, m[1]--, m[2]--);
+}
+
+mat4 __operator -- (inout mat4 m, const int) {
+ return mat4 (m[0]--, m[1]--, m[2]--, m[3]--);
+}
+
+float __operator ++ (inout float a, const int) {
+ float b = a;
+ ++a;
+ return b;
+}
+
+int __operator ++ (inout int a, const int) {
+ int b = a;
+ ++a;
+ return b;
+}
+
+vec2 __operator ++ (inout vec2 v, const int) {
+ return vec2 (v.x++, v.y++);
+}
+
+vec3 __operator ++ (inout vec3 v, const int) {
+ return vec3 (v.x++, v.y++, v.z++);
+}
+
+vec4 __operator ++ (inout vec4 v, const int) {
+ return vec4 (v.x++, v.y++, v.z++, v.w++);
+}
+
+ivec2 __operator ++ (inout ivec2 v, const int) {
+ return ivec2 (v.x++, v.y++);
+}
+
+ivec3 __operator ++ (inout ivec3 v, const int) {
+ return ivec3 (v.x++, v.y++, v.z++);
+}
+
+ivec4 __operator ++ (inout ivec4 v, const int) {
+ return ivec4 (v.x++, v.y++, v.z++, v.w++);
+}
+
+mat2 __operator ++ (inout mat2 m, const int) {
+ return mat2 (m[0]++, m[1]++);
+}
+
+mat3 __operator ++ (inout mat3 m, const int) {
+ return mat3 (m[0]++, m[1]++, m[2]++);
+}
+
+mat4 __operator ++ (inout mat4 m, const int) {
+ return mat4 (m[0]++, m[1]++, m[2]++, m[3]++);
+}
+
+bool __operator < (const float a, const float b) {
+ bool c;
+ __asm float_less c, a, b;
+ return c;
+}
+
+bool __operator < (const int a, const int b) {
+ return float (a) < float (b);
+}
+
+bool __operator > (const float a, const float b) {
+ bool c;
+ __asm float_less c, b, a;
+ return c;
+}
+
+bool __operator > (const int a, const int b) {
+ return float (a) > float (b);
+}
+
+bool __operator >= (const float a, const float b) {
+ bool g, e;
+ __asm float_less g, b, a;
+ __asm float_equal e, a, b;
+ return g || e;
+}
+
+bool __operator >= (const int a, const int b) {
+ return float (a) >= float (b);
+}
+
+bool __operator <= (const float a, const float b) {
+ bool g, e;
+ __asm float_less g, a, b;
+ __asm float_equal e, a, b;
+ return g || e;
+}
+
+bool __operator <= (const int a, const int b) {
+ return float (a) <= float (b);
+}
+
+bool __operator ^^ (const bool a, const bool b) {
+ return a != b;
+}
+
+//
+// These operators are handled internally by the compiler:
+//
+// bool __operator && (bool a, bool b) {
+// return a ? b : false;
+// }
+// bool __operator || (bool a, bool b) {
+// return a ? true : b;
+// }
+//
+
+bool __operator ! (const bool a) {
+ return a == false;
+}
+
+//
+// mesa-specific extension functions.
+//
+
+void print (const float f) {
+ __asm float_print f;
+}
+
+void print (const int i) {
+ __asm int_print i;
+}
+
+void print (const bool b) {
+ __asm bool_print b;
+}
+
+void print (const vec2 v) {
+ print (v.x);
+ print (v.y);
+}
+
+void print (const vec3 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+}
+
+void print (const vec4 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+ print (v.w);
+}
+
+void print (const ivec2 v) {
+ print (v.x);
+ print (v.y);
+}
+
+void print (const ivec3 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+}
+
+void print (const ivec4 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+ print (v.w);
+}
+
+void print (const bvec2 v) {
+ print (v.x);
+ print (v.y);
+}
+
+void print (const bvec3 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+}
+
+void print (const bvec4 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+ print (v.w);
+}
+
+void print (const mat2 m) {
+ print (m[0]);
+ print (m[1]);
+}
+
+void print (const mat3 m) {
+ print (m[0]);
+ print (m[1]);
+ print (m[2]);
+}
+
+void print (const mat4 m) {
+ print (m[0]);
+ print (m[1]);
+ print (m[2]);
+ print (m[3]);
+}
+
+void print (const sampler1D e) {
+ __asm int_print e;
+}
+
+void print (const sampler2D e) {
+ __asm int_print e;
+}
+
+void print (const sampler3D e) {
+ __asm int_print e;
+}
+
+void print (const samplerCube e) {
+ __asm int_print e;
+}
+
+void print (const sampler1DShadow e) {
+ __asm int_print e;
+}
+
+void print (const sampler2DShadow e) {
+ __asm int_print e;
+}
+
-\r
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\r
-/* slang_core.gc */\r
-\r
-3,1,0,5,1,1,1,0,9,102,0,0,0,1,3,2,0,5,1,105,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,\r
-18,105,0,0,18,102,0,0,0,8,18,105,0,0,0,1,0,1,1,1,1,0,5,105,0,0,0,1,8,18,105,0,16,8,48,0,39,0,0,1,0,\r
-1,1,1,1,0,9,102,0,0,0,1,8,18,102,0,17,48,0,48,0,0,39,0,0,1,0,5,1,1,1,0,1,98,0,0,0,1,8,18,98,0,16,\r
-10,49,0,16,8,48,0,31,0,0,1,0,9,1,1,1,0,1,98,0,0,0,1,8,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,\r
-1,0,9,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,102,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,\r
-18,102,0,0,18,105,0,0,0,8,18,102,0,0,0,1,0,1,1,1,1,0,1,98,0,0,0,1,8,18,98,0,0,0,1,0,5,1,1,1,0,5,\r
-105,0,0,0,1,8,18,105,0,0,0,1,0,9,1,1,1,0,9,102,0,0,0,1,8,18,102,0,0,0,1,0,10,1,1,1,0,9,102,0,0,0,1,\r
-8,58,118,101,99,50,0,18,102,0,0,18,102,0,0,0,0,0,1,0,10,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,\r
-4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,118,101,99,50,0,18,\r
-120,0,0,0,0,0,1,0,10,1,1,1,0,1,98,0,0,0,1,8,58,118,101,99,50,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,\r
-0,31,0,0,0,0,1,0,11,1,1,1,0,9,102,0,0,0,1,8,58,118,101,99,51,0,18,102,0,0,18,102,0,0,18,102,0,0,0,\r
-0,0,1,0,11,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,\r
-116,0,18,120,0,0,18,105,0,0,0,8,58,118,101,99,51,0,18,120,0,0,0,0,0,1,0,11,1,1,1,0,1,98,0,0,0,1,8,\r
-58,118,101,99,51,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,12,1,1,1,0,9,102,0,0,0,1,8,\r
-58,118,101,99,52,0,18,102,0,0,18,102,0,0,18,102,0,0,18,102,0,0,0,0,0,1,0,12,1,1,1,0,5,105,0,0,0,1,\r
-3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,\r
-118,101,99,52,0,18,120,0,0,0,0,0,1,0,12,1,1,1,0,1,98,0,0,0,1,8,58,118,101,99,52,0,18,98,0,17,49,0,\r
-48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,6,1,1,1,0,5,105,0,0,0,1,8,58,105,118,101,99,50,0,18,105,0,0,\r
-18,105,0,0,0,0,0,1,0,6,1,1,1,0,9,102,0,0,0,1,8,58,105,118,101,99,50,0,58,105,110,116,0,18,102,0,0,\r
-0,0,0,0,0,1,0,6,1,1,1,0,1,98,0,0,0,1,8,58,105,118,101,99,50,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,\r
-1,0,7,1,1,1,0,5,105,0,0,0,1,8,58,105,118,101,99,51,0,18,105,0,0,18,105,0,0,18,105,0,0,0,0,0,1,0,7,\r
-1,1,1,0,9,102,0,0,0,1,8,58,105,118,101,99,51,0,58,105,110,116,0,18,102,0,0,0,0,0,0,0,1,0,7,1,1,1,0,\r
-1,98,0,0,0,1,8,58,105,118,101,99,51,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,1,0,8,1,1,1,0,5,105,0,0,\r
-0,1,8,58,105,118,101,99,52,0,18,105,0,0,18,105,0,0,18,105,0,0,18,105,0,0,0,0,0,1,0,8,1,1,1,0,9,102,\r
-0,0,0,1,8,58,105,118,101,99,52,0,58,105,110,116,0,18,102,0,0,0,0,0,0,0,1,0,8,1,1,1,0,1,98,0,0,0,1,\r
-8,58,105,118,101,99,52,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,1,0,2,1,1,1,0,1,98,0,0,0,1,8,58,98,\r
-118,101,99,50,0,18,98,0,0,18,98,0,0,0,0,0,1,0,2,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,50,0,58,\r
-98,111,111,108,0,18,102,0,0,0,0,0,0,0,1,0,2,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,50,0,58,98,\r
-111,111,108,0,18,105,0,0,0,0,0,0,0,1,0,3,1,1,1,0,1,98,0,0,0,1,8,58,98,118,101,99,51,0,18,98,0,0,18,\r
-98,0,0,18,98,0,0,0,0,0,1,0,3,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,51,0,58,98,111,111,108,0,18,\r
-102,0,0,0,0,0,0,0,1,0,3,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,51,0,58,98,111,111,108,0,18,105,0,\r
-0,0,0,0,0,0,1,0,4,1,1,1,0,1,98,0,0,0,1,8,58,98,118,101,99,52,0,18,98,0,0,18,98,0,0,18,98,0,0,18,98,\r
-0,0,0,0,0,1,0,4,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,52,0,58,98,111,111,108,0,18,102,0,0,0,0,0,\r
-0,0,1,0,4,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,52,0,58,98,111,111,108,0,18,105,0,0,0,0,0,0,0,1,\r
-0,13,1,1,1,0,9,102,0,0,0,1,8,58,109,97,116,50,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,\r
-102,0,0,0,0,0,1,0,13,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,\r
-111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,109,97,116,50,0,18,120,0,0,0,0,0,1,0,13,1,1,1,0,1,98,0,0,\r
-0,1,8,58,109,97,116,50,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,14,1,1,1,0,9,102,0,0,\r
-0,1,8,58,109,97,116,51,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,\r
-17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,0,0,0,1,0,14,1,1,1,0,5,105,0,0,0,1,3,\r
-2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,\r
-109,97,116,51,0,18,120,0,0,0,0,0,1,0,14,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,51,0,18,98,0,17,49,0,\r
-48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,15,1,1,1,0,9,102,0,0,0,1,8,58,109,97,116,52,0,18,102,0,0,17,\r
-48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,\r
-0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,\r
-48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,0,0,0,1,0,15,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,\r
-110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,109,97,116,52,0,18,120,0,0,\r
-0,0,0,1,0,15,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,52,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,\r
-0,0,0,1,0,0,2,1,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,97,100,100,0,18,97,0,0,\r
-18,97,0,0,18,98,0,0,0,0,1,0,9,2,27,1,1,0,9,97,0,0,0,1,3,2,0,9,1,98,0,0,0,4,102,108,111,97,116,95,\r
-110,101,103,97,116,101,0,18,98,0,0,18,97,0,0,0,8,18,98,0,0,0,1,0,0,2,2,1,0,2,9,97,0,0,1,1,0,9,98,0,\r
-0,0,1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,99,0,0,18,98,0,0,0,4,\r
-102,108,111,97,116,95,97,100,100,0,18,97,0,0,18,97,0,0,18,99,0,0,0,0,1,0,0,2,3,1,0,2,9,97,0,0,1,1,\r
-0,9,98,0,0,0,1,4,102,108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,97,0,0,18,97,0,0,18,98,\r
-0,0,0,0,1,0,0,2,4,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,100,105,118,105,100,\r
-101,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,9,2,26,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,\r
-0,0,0,4,102,108,111,97,116,95,97,100,100,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,1,0,0,2,1,\r
-1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,111,97,116,0,18,97,0,0,0,\r
-58,102,108,111,97,116,0,18,98,0,0,0,46,0,0,20,0,0,1,0,5,2,27,1,1,0,5,97,0,0,0,1,3,2,0,9,1,120,0,0,\r
-0,3,2,0,5,1,98,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,102,\r
-108,111,97,116,95,110,101,103,97,116,101,0,18,120,0,0,18,120,0,0,0,4,102,108,111,97,116,95,116,111,\r
-95,105,110,116,0,18,98,0,0,18,120,0,0,0,8,18,98,0,0,0,1,0,0,2,2,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,\r
-9,18,97,0,18,98,0,54,21,0,0,1,0,9,2,21,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,0,0,0,4,102,\r
-108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,\r
-1,0,0,2,3,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,111,97,116,0,18,\r
-97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,48,0,0,20,0,0,1,0,9,2,22,1,1,0,9,97,0,0,1,1,0,9,98,0,\r
-0,0,1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,100,105,118,105,100,101,0,18,99,0,0,18,97,0,0,18,\r
-98,0,0,0,8,18,99,0,0,0,1,0,0,2,4,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,\r
-102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,49,0,0,20,0,0,1,0,0,2,1,1,0,2,\r
-10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,\r
-117,0,59,121,0,21,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,\r
-59,120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,10,117,\r
-0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,0,1,\r
-0,0,2,4,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,\r
-0,59,121,0,18,117,0,59,121,0,24,0,0,1,0,0,2,1,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,\r
-120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,117,\r
-0,59,122,0,21,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,\r
-120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,0,\r
-1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,\r
-118,0,59,121,0,18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,0,1,0,0,2,4,1,0,2,\r
-11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,\r
-117,0,59,121,0,24,0,9,18,118,0,59,122,0,18,117,0,59,122,0,24,0,0,1,0,0,2,1,1,0,2,12,118,0,0,1,1,0,\r
-12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,\r
-0,9,18,118,0,59,122,0,18,117,0,59,122,0,21,0,9,18,118,0,59,119,0,18,117,0,59,119,0,21,0,0,1,0,0,2,\r
-2,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,0,59,\r
-121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,9,18,118,0,59,119,0,18,117,\r
-0,59,119,0,22,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,\r
-120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,9,\r
-18,118,0,59,119,0,18,117,0,59,119,0,23,0,0,1,0,0,2,4,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,\r
-118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,118,0,59,122,\r
-0,18,117,0,59,122,0,24,0,9,18,118,0,59,119,0,18,117,0,59,119,0,24,0,0,1,0,0,2,1,1,0,2,6,118,0,0,1,\r
-1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,\r
-21,0,0,1,0,0,2,2,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,\r
-18,118,0,59,121,0,18,117,0,59,121,0,22,0,0,1,0,0,2,3,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,\r
-0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,0,1,0,0,2,4,1,0,2,6,\r
-118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,\r
-0,59,121,0,24,0,0,1,0,0,2,1,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,\r
-120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,117,0,59,122,0,21,0,0,\r
-1,0,0,2,2,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,\r
-0,59,121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,0,1,0,0,2,3,1,0,2,7,\r
-118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,\r
-0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,0,1,0,0,2,4,1,0,2,7,118,0,0,1,1,0,7,117,\r
-0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,\r
-118,0,59,122,0,18,117,0,59,122,0,24,0,0,1,0,0,2,1,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,\r
-59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,\r
-117,0,59,122,0,21,0,9,18,118,0,59,119,0,18,117,0,59,119,0,21,0,0,1,0,0,2,2,1,0,2,8,118,0,0,1,1,0,8,\r
-117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,\r
-9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,9,18,118,0,59,119,0,18,117,0,59,119,0,22,0,0,1,0,0,2,3,\r
-1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,\r
-18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,9,18,118,0,59,119,0,18,117,0,59,\r
-119,0,23,0,0,1,0,0,2,4,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,\r
-24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,118,0,59,122,0,18,117,0,59,122,0,24,0,9,18,\r
-118,0,59,119,0,18,117,0,59,119,0,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,\r
-16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,\r
-0,2,2,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,\r
-18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,10,2,21,1,1,0,13,109,0,0,1,1,0,10,118,0,0,\r
-0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,\r
-109,0,16,10,49,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,\r
-59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,0,0,0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,13,110,0,\r
-0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,\r
-0,0,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,\r
-0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,\r
-18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,\r
-1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,\r
-57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,14,\r
-110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,\r
-16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,11,2,21,1,1,0,14,109,\r
-0,0,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,\r
-18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,\r
-59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,\r
-10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,0,18,118,0,59,\r
-120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,\r
-118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,14,\r
-110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,\r
-57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,\r
-9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,\r
-16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,\r
-109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,\r
-9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,\r
-21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,\r
-51,0,57,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,\r
-8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,\r
-110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,12,2,21,1,1,0,\r
-15,109,0,0,1,1,0,12,118,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,\r
-120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,\r
-50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,48,46,0,18,118,0,59,120,0,\r
-18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,\r
-59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,\r
-48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,\r
-57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,\r
-0,16,10,51,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,\r
-121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48,\r
-46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,15,2,21,1,1,0,15,109,0,0,1,\r
-1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,\r
-10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,\r
-0,0,2,3,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,\r
-2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,\r
-10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,\r
-109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,2,1,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,\r
-18,118,0,59,120,0,18,97,0,21,0,9,18,118,0,59,121,0,18,97,0,21,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,\r
-9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,18,97,0,22,0,0,1,0,0,2,3,1,0,2,\r
-10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,0,\r
-1,0,0,2,4,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,\r
-18,97,0,24,0,0,1,0,0,2,1,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,21,0,9,18,\r
-118,0,59,121,0,18,97,0,21,0,9,18,118,0,59,122,0,18,97,0,21,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,9,\r
-97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,18,97,0,22,0,9,18,118,0,59,122,0,\r
-18,97,0,22,0,0,1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,\r
-118,0,59,121,0,18,97,0,23,0,9,18,118,0,59,122,0,18,97,0,23,0,0,1,0,0,2,4,1,0,2,11,118,0,0,1,1,0,9,\r
-97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,9,18,118,0,59,122,0,\r
-18,97,0,24,0,0,1,0,0,2,1,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,21,0,9,18,\r
-118,0,59,121,0,18,97,0,21,0,9,18,118,0,59,122,0,18,97,0,21,0,9,18,118,0,59,119,0,18,97,0,21,0,0,1,\r
-0,0,2,2,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,\r
-18,97,0,22,0,9,18,118,0,59,122,0,18,97,0,22,0,9,18,118,0,59,119,0,18,97,0,22,0,0,1,0,0,2,3,1,0,2,\r
-12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,9,\r
-18,118,0,59,122,0,18,97,0,23,0,9,18,118,0,59,119,0,18,97,0,23,0,0,1,0,0,2,4,1,0,2,12,118,0,0,1,1,0,\r
-9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,9,18,118,0,59,122,0,\r
-18,97,0,24,0,9,18,118,0,59,119,0,18,97,0,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,\r
-109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,13,109,0,0,\r
-1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,\r
-0,0,2,3,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,\r
-49,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,\r
-0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,\r
-109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,\r
-97,0,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,\r
-18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,14,109,\r
-0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,\r
-9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,\r
-16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,\r
-24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,\r
-0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,\r
-0,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,\r
-109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,\r
-97,0,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,\r
-18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,\r
-18,97,0,23,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,\r
-9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,\r
-57,18,97,0,24,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,13,109,0,0,0,1,8,58,118,101,99,50,0,18,118,0,\r
-59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,\r
-0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,\r
-121,0,48,46,0,0,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,\r
-48,20,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1,0,14,109,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,\r
-18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,\r
-59,122,0,18,109,0,16,8,48,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,\r
-48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,49,0,\r
-57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,\r
-0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,1,0,\r
-0,2,3,1,0,2,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,12,2,21,1,1,\r
-0,12,118,0,0,1,1,0,15,109,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,\r
-120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,\r
-0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,8,48,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,\r
-109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,\r
-59,122,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,49,0,57,59,119,0,\r
-48,46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,\r
-57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,\r
-0,16,10,50,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,51,0,57,59,120,0,48,18,118,0,59,\r
-121,0,18,109,0,16,10,51,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,51,0,57,59,122,0,48,\r
-46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,\r
-0,15,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,9,2,27,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,\r
-1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,99,0,0,18,98,0,0,0,4,102,\r
-108,111,97,116,95,97,100,100,0,18,99,0,0,18,97,0,0,18,99,0,0,0,8,18,99,0,0,0,1,0,5,2,26,1,1,0,5,97,\r
-0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,111,\r
-95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,\r
-121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,97,100,100,0,18,120,0,0,18,120,0,0,18,121,0,0,0,4,102,\r
-108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,27,1,1,0,5,\r
-97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,\r
-111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,\r
-0,18,121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,121,0,0,18,121,0,0,0,\r
-4,102,108,111,97,116,95,97,100,100,0,18,120,0,0,18,120,0,0,18,121,0,0,0,4,102,108,111,97,116,95,\r
-116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,21,1,1,0,5,97,0,0,1,1,0,5,98,\r
-0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,111,95,102,108,111,\r
-97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,121,0,0,18,98,\r
-0,0,0,4,102,108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,120,0,0,18,121,0,0,0,\r
-4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,22,1,\r
-1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,\r
-95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,\r
-97,116,0,18,121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,100,105,118,105,100,101,0,18,120,0,0,18,\r
-120,0,0,18,121,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,\r
-99,0,0,0,1,0,10,2,26,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,\r
-18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,\r
-1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,\r
-0,18,117,0,59,121,0,47,0,0,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,\r
-50,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,\r
-10,2,22,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,\r
-120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,11,\r
-117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,\r
-0,59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,1,1,0,\r
-11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,\r
-117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,0,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,\r
-1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,\r
-18,117,0,59,121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,11,2,22,1,1,0,11,118,0,0,\r
-1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,\r
-0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,12,2,26,1,1,0,12,118,0,\r
-0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,\r
-121,0,18,117,0,59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,\r
-59,119,0,46,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,\r
-0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,\r
-117,0,59,122,0,47,0,18,118,0,59,119,0,18,117,0,59,119,0,47,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,\r
-1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,\r
-18,117,0,59,121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,\r
-0,48,0,0,0,0,1,0,12,2,22,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,\r
-120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,\r
-59,122,0,49,0,18,118,0,59,119,0,18,117,0,59,119,0,49,0,0,0,0,1,0,6,2,26,1,1,0,6,118,0,0,1,1,0,6,\r
-117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,\r
-117,0,59,121,0,46,0,0,0,0,1,0,6,2,27,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,\r
-18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,0,0,0,1,0,6,2,21,\r
-1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,\r
-48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,6,2,22,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,\r
-8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,\r
-121,0,49,0,0,0,0,1,0,7,2,26,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,\r
-59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,118,0,59,122,0,18,117,\r
-0,59,122,0,46,0,0,0,0,1,0,7,2,27,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,\r
-118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,\r
-18,117,0,59,122,0,47,0,0,0,0,1,0,7,2,21,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,\r
-0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,18,118,0,59,\r
-122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,7,2,22,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,\r
-99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,\r
-59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,8,2,26,1,1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,\r
-101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,\r
-118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,59,119,0,46,0,0,0,0,1,0,8,2,27,1,\r
-1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,47,\r
-0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,18,118,0,59,\r
-119,0,18,117,0,59,119,0,47,0,0,0,0,1,0,8,2,21,1,1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,\r
-99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,18,118,0,\r
-59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,0,48,0,0,0,0,1,0,8,2,22,1,1,0,8,\r
-118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,\r
-118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,18,118,0,59,119,0,\r
-18,117,0,59,119,0,49,0,0,0,0,1,0,13,2,26,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,\r
-0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,\r
-46,0,0,0,0,1,0,13,2,27,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,\r
-0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,13,2,\r
-22,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,\r
-48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,14,2,26,1,1,0,14,109,0,0,\r
-1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,\r
-0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,\r
-0,1,0,14,2,27,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,\r
-110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,\r
-18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,\r
-116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,\r
-0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,\r
-1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,\r
-16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,\r
-109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,27,1,1,0,15,109,0,0,1,1,0,15,110,0,\r
-0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,\r
-18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,\r
-57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,15,2,22,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,\r
-116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,\r
-0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,\r
-51,0,57,49,0,0,0,0,1,0,10,2,26,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,\r
-117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,0,0,0,1,0,10,2,26,1,1,0,10,118,0,0,1,1,0,9,98,0,\r
-0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,0,0,0,1,0,\r
-10,2,27,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,47,0,18,\r
-97,0,18,117,0,59,121,0,47,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,\r
-50,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,0,0,0,1,0,10,2,21,1,1,0,9,97,0,\r
-0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,\r
-0,48,0,0,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,\r
-0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,0,0,0,1,0,10,2,22,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,\r
-1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,0,0,0,1,0,10,\r
-2,22,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,49,0,18,\r
-118,0,59,121,0,18,98,0,49,0,0,0,0,1,0,11,2,26,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,\r
-51,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,117,0,59,122,0,46,0,\r
-0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,\r
-0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,0,18,98,0,46,0,0,0,0,1,0,11,2,27,1,1,0,9,97,\r
-0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,47,0,18,97,0,18,117,0,59,\r
-121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,\r
-58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,118,0,59,122,0,\r
-18,98,0,47,0,0,0,0,1,0,11,2,21,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,\r
-117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,18,97,0,18,117,0,59,122,0,48,0,0,0,0,1,0,11,2,\r
-21,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,48,0,18,118,\r
-0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,0,0,0,0,1,0,11,2,22,1,1,0,9,97,0,0,1,1,0,11,\r
-117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,18,\r
-97,0,18,117,0,59,122,0,49,0,0,0,0,1,0,11,2,22,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,\r
-51,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,\r
-0,0,0,1,0,12,2,26,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,59,120,\r
-0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,117,0,59,122,0,46,0,18,97,0,18,117,0,59,119,0,46,\r
-0,0,0,0,1,0,12,2,26,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,\r
-98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,0,18,98,0,46,0,18,118,0,59,119,0,18,98,0,\r
-46,0,0,0,0,1,0,12,2,27,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,\r
-59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,18,97,0,18,117,0,59,\r
-119,0,47,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,\r
-120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,118,0,59,122,0,18,98,0,47,0,18,118,0,59,119,0,\r
-18,98,0,47,0,0,0,0,1,0,12,2,21,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,\r
-117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,18,97,0,18,117,0,59,122,0,48,0,18,97,0,18,117,0,\r
-59,119,0,48,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,\r
-59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,0,18,118,0,59,\r
-119,0,18,98,0,48,0,0,0,0,1,0,12,2,22,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,\r
-97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,18,97,0,18,117,0,59,122,0,49,0,18,97,0,\r
-18,117,0,59,119,0,49,0,0,0,0,1,0,12,2,22,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,\r
-18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,18,\r
-118,0,59,119,0,18,98,0,49,0,0,0,0,1,0,13,2,26,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,\r
-50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,13,2,26,1,1,\r
-0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,\r
-16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,13,2,27,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,\r
-50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,13,2,27,1,1,\r
-0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,\r
-16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,13,2,21,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,\r
-50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,13,2,21,1,1,\r
-0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,\r
-16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,13,2,22,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,\r
-50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,13,2,22,1,1,\r
-0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,\r
-16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,14,2,26,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,\r
-51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,\r
-50,0,57,46,0,0,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,\r
-16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,\r
-0,0,0,1,0,14,2,27,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,\r
-48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,14,\r
-2,27,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,\r
-18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,14,2,21,1,1,0,9,\r
-97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,\r
-0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,\r
-9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,\r
-0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,0,0,0,1,0,14,2,22,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,\r
-58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,97,0,\r
-18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,\r
-51,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,\r
-18,98,0,49,0,0,0,0,1,0,15,2,26,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,\r
-110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,\r
-97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,\r
-116,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,\r
-0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,15,2,27,1,1,0,9,97,0,0,1,1,0,15,\r
-110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,\r
-47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,15,2,27,1,1,\r
-0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,\r
-16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,\r
-0,0,0,1,0,15,2,21,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,\r
-48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,18,97,0,18,\r
-110,0,16,10,51,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,\r
-0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,\r
-98,0,48,0,18,109,0,16,10,51,0,57,18,98,0,48,0,0,0,0,1,0,15,2,22,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,\r
-1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,\r
-97,0,18,110,0,16,10,50,0,57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,15,2,22,1,1,0,15,\r
-109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,\r
-49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,18,109,0,16,10,51,0,57,18,98,0,49,0,0,0,0,\r
-1,0,6,2,26,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,46,0,0,\r
-1,0,6,2,26,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,46,0,0,\r
-1,0,6,2,27,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,47,0,0,\r
-1,0,6,2,27,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,47,0,0,\r
-1,0,6,2,21,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,48,0,0,\r
-1,0,6,2,21,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,48,0,0,\r
-1,0,6,2,22,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,49,0,0,\r
-1,0,6,2,22,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,49,0,0,\r
-1,0,7,2,26,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,46,0,0,\r
-1,0,7,2,26,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,46,0,0,\r
-1,0,7,2,27,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,47,0,0,\r
-1,0,7,2,27,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,47,0,0,\r
-1,0,7,2,21,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,48,0,0,\r
-1,0,7,2,21,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,48,0,0,\r
-1,0,7,2,22,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,49,0,0,\r
-1,0,7,2,22,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,49,0,0,\r
-1,0,8,2,26,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,46,0,0,\r
-1,0,8,2,26,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,46,0,0,\r
-1,0,8,2,27,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,47,0,0,\r
-1,0,8,2,27,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,47,0,0,\r
-1,0,8,2,21,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,48,0,0,\r
-1,0,8,2,21,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,48,0,0,\r
-1,0,8,2,22,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,49,0,0,\r
-1,0,8,2,22,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,49,0,0,\r
-1,0,10,2,27,1,1,0,10,118,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,\r
-0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,54,0,18,118,0,59,\r
-121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,0,1,8,58,118,101,99,52,0,18,\r
-118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,\r
-6,2,27,1,1,0,6,118,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,\r
-0,0,0,1,0,7,2,27,1,1,0,7,118,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,54,0,18,118,0,59,\r
-121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,8,2,27,1,1,0,8,118,0,0,0,1,8,58,105,118,101,99,52,0,18,\r
-118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,\r
-13,2,27,1,1,0,13,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,\r
-57,54,0,0,0,0,1,0,14,2,27,1,1,0,14,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,54,0,18,\r
-109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,15,2,27,1,1,0,15,109,0,0,0,1,8,58,\r
-109,97,116,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,\r
-18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,9,97,0,0,0,1,9,18,97,0,17,49,0,48,0,0,22,0,0,1,\r
-0,0,2,25,1,0,2,5,97,0,0,0,1,9,18,97,0,16,10,49,0,22,0,0,1,0,0,2,25,1,0,2,10,118,0,0,0,1,9,18,118,0,\r
-59,120,0,52,0,9,18,118,0,59,121,0,52,0,0,1,0,0,2,25,1,0,2,11,118,0,0,0,1,9,18,118,0,59,120,0,52,0,\r
-9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,0,1,0,0,2,25,1,0,2,12,118,0,0,0,1,9,18,118,0,59,\r
-120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,9,18,118,0,59,119,0,52,0,0,1,0,0,2,25,\r
-1,0,2,6,118,0,0,0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,0,1,0,0,2,25,1,0,2,7,118,0,0,\r
-0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,0,1,0,0,2,25,1,0,2,\r
-8,118,0,0,0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,9,18,118,\r
-0,59,119,0,52,0,0,1,0,0,2,25,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,\r
-0,57,52,0,0,1,0,0,2,25,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,\r
-52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,\r
-9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,\r
-2,24,1,0,2,9,97,0,0,0,1,9,18,97,0,17,49,0,48,0,0,21,0,0,1,0,0,2,24,1,0,2,5,97,0,0,0,1,9,18,97,0,16,\r
-10,49,0,21,0,0,1,0,0,2,24,1,0,2,10,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,0,\r
-1,0,0,2,24,1,0,2,11,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,9,18,118,0,59,\r
-122,0,51,0,0,1,0,0,2,24,1,0,2,12,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,9,\r
-18,118,0,59,122,0,51,0,9,18,118,0,59,119,0,51,0,0,1,0,0,2,24,1,0,2,6,118,0,0,0,1,9,18,118,0,59,120,\r
-0,51,0,9,18,118,0,59,121,0,51,0,0,1,0,0,2,24,1,0,2,7,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,\r
-0,59,121,0,51,0,9,18,118,0,59,122,0,51,0,0,1,0,0,2,24,1,0,2,8,118,0,0,0,1,9,18,118,0,59,120,0,51,0,\r
-9,18,118,0,59,121,0,51,0,9,18,118,0,59,122,0,51,0,9,18,118,0,59,119,0,51,0,0,1,0,0,2,24,1,0,2,13,\r
-109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,0,0,2,24,1,0,2,14,109,0,\r
-0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,\r
-0,0,2,24,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,\r
-0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,1,0,9,2,25,1,0,2,9,97,0,0,1,1,0,5,0,0,0,1,3,2,\r
-0,9,1,98,0,2,18,97,0,0,0,9,18,97,0,52,0,8,18,98,0,0,0,1,0,5,2,25,1,0,2,5,97,0,0,1,1,0,5,0,0,0,1,3,\r
-2,0,5,1,98,0,2,18,97,0,0,0,9,18,97,0,52,0,8,18,98,0,0,0,1,0,10,2,25,1,0,2,10,118,0,0,1,1,0,5,0,0,0,\r
-1,8,58,118,101,99,50,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,0,0,0,1,0,11,2,25,1,0,2,11,\r
-118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,\r
-0,59,122,0,61,0,0,0,0,1,0,12,2,25,1,0,2,12,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,52,0,18,118,0,\r
-59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,18,118,0,59,119,0,61,0,0,0,0,1,0,6,2,\r
-25,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,61,0,18,118,0,59,121,\r
-0,61,0,0,0,0,1,0,7,2,25,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,\r
-61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,0,0,0,1,0,8,2,25,1,0,2,8,118,0,0,1,1,0,5,0,0,0,\r
-1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,18,\r
-118,0,59,119,0,61,0,0,0,0,1,0,13,2,25,1,0,2,13,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,0,18,109,\r
-0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,0,0,0,1,0,14,2,25,1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,\r
-8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,\r
-61,0,0,0,0,1,0,15,2,25,1,0,2,15,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,\r
-61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0,18,109,0,16,10,51,0,57,61,0,0,0,0,1,0,\r
-9,2,24,1,0,2,9,97,0,0,1,1,0,5,0,0,0,1,3,2,0,9,1,98,0,2,18,97,0,0,0,9,18,97,0,51,0,8,18,98,0,0,0,1,\r
-0,5,2,24,1,0,2,5,97,0,0,1,1,0,5,0,0,0,1,3,2,0,5,1,98,0,2,18,97,0,0,0,9,18,97,0,51,0,8,18,98,0,0,0,\r
-1,0,10,2,24,1,0,2,10,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,60,0,18,118,0,\r
-59,121,0,60,0,0,0,0,1,0,11,2,24,1,0,2,11,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,\r
-120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,0,0,0,1,0,12,2,24,1,0,2,12,118,0,0,1,1,0,\r
-5,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,\r
-0,18,118,0,59,119,0,60,0,0,0,0,1,0,6,2,24,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,\r
-18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,0,0,0,1,0,7,2,24,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,\r
-58,105,118,101,99,51,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,0,0,0,\r
-1,0,8,2,24,1,0,2,8,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,60,0,18,118,\r
-0,59,121,0,60,0,18,118,0,59,122,0,60,0,18,118,0,59,119,0,60,0,0,0,0,1,0,13,2,24,1,0,2,13,109,0,0,1,\r
-1,0,5,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,0,0,0,1,\r
-0,14,2,24,1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,60,0,18,109,\r
-0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,0,0,0,1,0,15,2,24,1,0,2,15,109,0,0,1,1,0,5,0,0,0,\r
-1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,\r
-57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,1,0,1,2,15,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,\r
-99,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,1,\r
-0,1,2,15,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,\r
-116,0,18,98,0,0,0,40,0,0,1,0,1,2,16,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,99,0,0,0,4,102,108,\r
-111,97,116,95,108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,0,1,2,16,1,1,0,5,\r
-97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,\r
-0,41,0,0,1,0,1,2,18,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,\r
-111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,101,113,\r
-117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,18,1,1,0,5,97,0,0,\r
-1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,43,0,\r
-0,1,0,1,2,17,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,\r
-116,95,108,101,115,115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,\r
-108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,17,1,1,0,5,97,0,0,1,1,0,\r
-5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,42,0,0,1,0,\r
-1,2,11,1,1,0,1,97,0,0,1,1,0,1,98,0,0,0,1,8,18,97,0,18,98,0,39,0,0,1,0,1,2,29,1,1,0,1,97,0,0,0,1,8,\r
-18,97,0,15,2,48,0,38,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,9,102,0,0,0,1,4,102,108,111,97,116,95,\r
-112,114,105,110,116,0,18,102,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,5,105,0,0,0,1,4,105,110,\r
-116,95,112,114,105,110,116,0,18,105,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,1,98,0,0,0,1,4,98,\r
-111,111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,10,118,0,0,\r
-0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,\r
-0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,11,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,\r
-59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,\r
-118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,12,118,0,0,0,1,9,58,112,114,105,110,116,\r
-0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,\r
-116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,\r
-105,110,116,0,1,1,0,6,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,\r
-105,110,116,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,7,118,0,0,0,1,9,58,112,\r
-114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,\r
-112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,8,118,0,0,0,1,\r
-9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,\r
-0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,119,\r
-0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,2,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,\r
-120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,\r
-0,3,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,\r
-118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,\r
-116,0,1,1,0,4,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,\r
-116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,\r
-110,116,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,13,109,0,0,0,1,9,58,112,\r
-114,105,110,116,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,\r
-0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,14,109,0,0,0,1,9,58,112,114,105,110,116,0,18,109,0,16,8,\r
-48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,0,\r
-18,109,0,16,10,50,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,15,109,0,0,0,1,9,58,112,114,105,\r
-110,116,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,0,0,9,58,\r
-112,114,105,110,116,0,18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,51,0,\r
-57,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,16,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,\r
-0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,17,101,0,0,0,1,4,105,110,116,95,112,114,105,\r
-110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,18,101,0,0,0,1,4,105,110,116,95,112,\r
-114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,19,101,0,0,0,1,4,105,110,116,\r
-95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,20,101,0,0,0,1,4,105,\r
-110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,21,101,0,0,0,1,\r
-4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0\r
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_core.gc */
+
+3,1,0,5,1,1,1,0,9,102,0,0,0,1,3,2,0,5,1,105,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,
+18,105,0,0,18,102,0,0,0,8,18,105,0,0,0,1,0,1,1,1,1,0,5,105,0,0,0,1,8,18,105,0,16,8,48,0,39,0,0,1,0,
+1,1,1,1,0,9,102,0,0,0,1,8,18,102,0,17,48,0,48,0,0,39,0,0,1,0,5,1,1,1,0,1,98,0,0,0,1,8,18,98,0,16,
+10,49,0,16,8,48,0,31,0,0,1,0,9,1,1,1,0,1,98,0,0,0,1,8,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,
+1,0,9,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,102,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,
+18,102,0,0,18,105,0,0,0,8,18,102,0,0,0,1,0,1,1,1,1,0,1,98,0,0,0,1,8,18,98,0,0,0,1,0,5,1,1,1,0,5,
+105,0,0,0,1,8,18,105,0,0,0,1,0,9,1,1,1,0,9,102,0,0,0,1,8,18,102,0,0,0,1,0,10,1,1,1,0,9,102,0,0,0,1,
+8,58,118,101,99,50,0,18,102,0,0,18,102,0,0,0,0,0,1,0,10,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,
+4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,118,101,99,50,0,18,
+120,0,0,0,0,0,1,0,10,1,1,1,0,1,98,0,0,0,1,8,58,118,101,99,50,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,
+0,31,0,0,0,0,1,0,11,1,1,1,0,9,102,0,0,0,1,8,58,118,101,99,51,0,18,102,0,0,18,102,0,0,18,102,0,0,0,
+0,0,1,0,11,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,
+116,0,18,120,0,0,18,105,0,0,0,8,58,118,101,99,51,0,18,120,0,0,0,0,0,1,0,11,1,1,1,0,1,98,0,0,0,1,8,
+58,118,101,99,51,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,12,1,1,1,0,9,102,0,0,0,1,8,
+58,118,101,99,52,0,18,102,0,0,18,102,0,0,18,102,0,0,18,102,0,0,0,0,0,1,0,12,1,1,1,0,5,105,0,0,0,1,
+3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,
+118,101,99,52,0,18,120,0,0,0,0,0,1,0,12,1,1,1,0,1,98,0,0,0,1,8,58,118,101,99,52,0,18,98,0,17,49,0,
+48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,6,1,1,1,0,5,105,0,0,0,1,8,58,105,118,101,99,50,0,18,105,0,0,
+18,105,0,0,0,0,0,1,0,6,1,1,1,0,9,102,0,0,0,1,8,58,105,118,101,99,50,0,58,105,110,116,0,18,102,0,0,
+0,0,0,0,0,1,0,6,1,1,1,0,1,98,0,0,0,1,8,58,105,118,101,99,50,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,
+1,0,7,1,1,1,0,5,105,0,0,0,1,8,58,105,118,101,99,51,0,18,105,0,0,18,105,0,0,18,105,0,0,0,0,0,1,0,7,
+1,1,1,0,9,102,0,0,0,1,8,58,105,118,101,99,51,0,58,105,110,116,0,18,102,0,0,0,0,0,0,0,1,0,7,1,1,1,0,
+1,98,0,0,0,1,8,58,105,118,101,99,51,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,1,0,8,1,1,1,0,5,105,0,0,
+0,1,8,58,105,118,101,99,52,0,18,105,0,0,18,105,0,0,18,105,0,0,18,105,0,0,0,0,0,1,0,8,1,1,1,0,9,102,
+0,0,0,1,8,58,105,118,101,99,52,0,58,105,110,116,0,18,102,0,0,0,0,0,0,0,1,0,8,1,1,1,0,1,98,0,0,0,1,
+8,58,105,118,101,99,52,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,1,0,2,1,1,1,0,1,98,0,0,0,1,8,58,98,
+118,101,99,50,0,18,98,0,0,18,98,0,0,0,0,0,1,0,2,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,50,0,58,
+98,111,111,108,0,18,102,0,0,0,0,0,0,0,1,0,2,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,50,0,58,98,
+111,111,108,0,18,105,0,0,0,0,0,0,0,1,0,3,1,1,1,0,1,98,0,0,0,1,8,58,98,118,101,99,51,0,18,98,0,0,18,
+98,0,0,18,98,0,0,0,0,0,1,0,3,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,51,0,58,98,111,111,108,0,18,
+102,0,0,0,0,0,0,0,1,0,3,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,51,0,58,98,111,111,108,0,18,105,0,
+0,0,0,0,0,0,1,0,4,1,1,1,0,1,98,0,0,0,1,8,58,98,118,101,99,52,0,18,98,0,0,18,98,0,0,18,98,0,0,18,98,
+0,0,0,0,0,1,0,4,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,52,0,58,98,111,111,108,0,18,102,0,0,0,0,0,
+0,0,1,0,4,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,52,0,58,98,111,111,108,0,18,105,0,0,0,0,0,0,0,1,
+0,13,1,1,1,0,9,102,0,0,0,1,8,58,109,97,116,50,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,
+102,0,0,0,0,0,1,0,13,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,
+111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,109,97,116,50,0,18,120,0,0,0,0,0,1,0,13,1,1,1,0,1,98,0,0,
+0,1,8,58,109,97,116,50,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,14,1,1,1,0,9,102,0,0,
+0,1,8,58,109,97,116,51,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,
+17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,0,0,0,1,0,14,1,1,1,0,5,105,0,0,0,1,3,
+2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,
+109,97,116,51,0,18,120,0,0,0,0,0,1,0,14,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,51,0,18,98,0,17,49,0,
+48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,15,1,1,1,0,9,102,0,0,0,1,8,58,109,97,116,52,0,18,102,0,0,17,
+48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,
+0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,
+48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,0,0,0,1,0,15,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,
+110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,109,97,116,52,0,18,120,0,0,
+0,0,0,1,0,15,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,52,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,
+0,0,0,1,0,0,2,1,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,97,100,100,0,18,97,0,0,
+18,97,0,0,18,98,0,0,0,0,1,0,9,2,27,1,1,0,9,97,0,0,0,1,3,2,0,9,1,98,0,0,0,4,102,108,111,97,116,95,
+110,101,103,97,116,101,0,18,98,0,0,18,97,0,0,0,8,18,98,0,0,0,1,0,0,2,2,1,0,2,9,97,0,0,1,1,0,9,98,0,
+0,0,1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,99,0,0,18,98,0,0,0,4,
+102,108,111,97,116,95,97,100,100,0,18,97,0,0,18,97,0,0,18,99,0,0,0,0,1,0,0,2,3,1,0,2,9,97,0,0,1,1,
+0,9,98,0,0,0,1,4,102,108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,97,0,0,18,97,0,0,18,98,
+0,0,0,0,1,0,0,2,4,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,100,105,118,105,100,
+101,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,9,2,26,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,
+0,0,0,4,102,108,111,97,116,95,97,100,100,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,1,0,0,2,1,
+1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,111,97,116,0,18,97,0,0,0,
+58,102,108,111,97,116,0,18,98,0,0,0,46,0,0,20,0,0,1,0,5,2,27,1,1,0,5,97,0,0,0,1,3,2,0,9,1,120,0,0,
+0,3,2,0,5,1,98,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,102,
+108,111,97,116,95,110,101,103,97,116,101,0,18,120,0,0,18,120,0,0,0,4,102,108,111,97,116,95,116,111,
+95,105,110,116,0,18,98,0,0,18,120,0,0,0,8,18,98,0,0,0,1,0,0,2,2,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,
+9,18,97,0,18,98,0,54,21,0,0,1,0,9,2,21,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,0,0,0,4,102,
+108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,
+1,0,0,2,3,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,111,97,116,0,18,
+97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,48,0,0,20,0,0,1,0,9,2,22,1,1,0,9,97,0,0,1,1,0,9,98,0,
+0,0,1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,100,105,118,105,100,101,0,18,99,0,0,18,97,0,0,18,
+98,0,0,0,8,18,99,0,0,0,1,0,0,2,4,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,
+102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,49,0,0,20,0,0,1,0,0,2,1,1,0,2,
+10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,
+117,0,59,121,0,21,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,
+59,120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,10,117,
+0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,0,1,
+0,0,2,4,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,
+0,59,121,0,18,117,0,59,121,0,24,0,0,1,0,0,2,1,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,
+120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,117,
+0,59,122,0,21,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
+120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,0,
+1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,
+118,0,59,121,0,18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,0,1,0,0,2,4,1,0,2,
+11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,
+117,0,59,121,0,24,0,9,18,118,0,59,122,0,18,117,0,59,122,0,24,0,0,1,0,0,2,1,1,0,2,12,118,0,0,1,1,0,
+12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,
+0,9,18,118,0,59,122,0,18,117,0,59,122,0,21,0,9,18,118,0,59,119,0,18,117,0,59,119,0,21,0,0,1,0,0,2,
+2,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,0,59,
+121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,9,18,118,0,59,119,0,18,117,
+0,59,119,0,22,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
+120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,9,
+18,118,0,59,119,0,18,117,0,59,119,0,23,0,0,1,0,0,2,4,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,
+118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,118,0,59,122,
+0,18,117,0,59,122,0,24,0,9,18,118,0,59,119,0,18,117,0,59,119,0,24,0,0,1,0,0,2,1,1,0,2,6,118,0,0,1,
+1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,
+21,0,0,1,0,0,2,2,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,
+18,118,0,59,121,0,18,117,0,59,121,0,22,0,0,1,0,0,2,3,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,
+0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,0,1,0,0,2,4,1,0,2,6,
+118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,
+0,59,121,0,24,0,0,1,0,0,2,1,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
+120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,117,0,59,122,0,21,0,0,
+1,0,0,2,2,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,
+0,59,121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,0,1,0,0,2,3,1,0,2,7,
+118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,
+0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,0,1,0,0,2,4,1,0,2,7,118,0,0,1,1,0,7,117,
+0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,
+118,0,59,122,0,18,117,0,59,122,0,24,0,0,1,0,0,2,1,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,
+59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,
+117,0,59,122,0,21,0,9,18,118,0,59,119,0,18,117,0,59,119,0,21,0,0,1,0,0,2,2,1,0,2,8,118,0,0,1,1,0,8,
+117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,
+9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,9,18,118,0,59,119,0,18,117,0,59,119,0,22,0,0,1,0,0,2,3,
+1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,
+18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,9,18,118,0,59,119,0,18,117,0,59,
+119,0,23,0,0,1,0,0,2,4,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,
+24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,118,0,59,122,0,18,117,0,59,122,0,24,0,9,18,
+118,0,59,119,0,18,117,0,59,119,0,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,
+16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,
+0,2,2,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,
+18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,10,2,21,1,1,0,13,109,0,0,1,1,0,10,118,0,0,
+0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,
+109,0,16,10,49,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,
+59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,0,0,0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,13,110,0,
+0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,
+0,0,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,
+0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,
+18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,
+1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,
+57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,14,
+110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,
+16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,11,2,21,1,1,0,14,109,
+0,0,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,
+18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,
+59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,
+10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,0,18,118,0,59,
+120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,
+118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,14,
+110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,
+57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,
+9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,
+16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,
+109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,
+9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,
+21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,
+51,0,57,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,
+8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,
+110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,12,2,21,1,1,0,
+15,109,0,0,1,1,0,12,118,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,
+120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,
+50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,48,46,0,18,118,0,59,120,0,
+18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,
+59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,
+48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,
+57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,
+0,16,10,51,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,
+121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48,
+46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,15,2,21,1,1,0,15,109,0,0,1,
+1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,
+10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,
+0,0,2,3,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,
+2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,
+10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,
+109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,2,1,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,
+18,118,0,59,120,0,18,97,0,21,0,9,18,118,0,59,121,0,18,97,0,21,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,
+9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,18,97,0,22,0,0,1,0,0,2,3,1,0,2,
+10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,0,
+1,0,0,2,4,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,
+18,97,0,24,0,0,1,0,0,2,1,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,21,0,9,18,
+118,0,59,121,0,18,97,0,21,0,9,18,118,0,59,122,0,18,97,0,21,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,9,
+97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,18,97,0,22,0,9,18,118,0,59,122,0,
+18,97,0,22,0,0,1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,
+118,0,59,121,0,18,97,0,23,0,9,18,118,0,59,122,0,18,97,0,23,0,0,1,0,0,2,4,1,0,2,11,118,0,0,1,1,0,9,
+97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,9,18,118,0,59,122,0,
+18,97,0,24,0,0,1,0,0,2,1,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,21,0,9,18,
+118,0,59,121,0,18,97,0,21,0,9,18,118,0,59,122,0,18,97,0,21,0,9,18,118,0,59,119,0,18,97,0,21,0,0,1,
+0,0,2,2,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,
+18,97,0,22,0,9,18,118,0,59,122,0,18,97,0,22,0,9,18,118,0,59,119,0,18,97,0,22,0,0,1,0,0,2,3,1,0,2,
+12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,9,
+18,118,0,59,122,0,18,97,0,23,0,9,18,118,0,59,119,0,18,97,0,23,0,0,1,0,0,2,4,1,0,2,12,118,0,0,1,1,0,
+9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,9,18,118,0,59,122,0,
+18,97,0,24,0,9,18,118,0,59,119,0,18,97,0,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,
+109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,13,109,0,0,
+1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,
+0,0,2,3,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,
+49,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,
+0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,
+109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,
+97,0,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,
+18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,14,109,
+0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,
+9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,
+16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,
+24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,
+0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,
+0,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,
+109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,
+97,0,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,
+18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,
+18,97,0,23,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,
+9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,
+57,18,97,0,24,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,13,109,0,0,0,1,8,58,118,101,99,50,0,18,118,0,
+59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,
+0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,
+121,0,48,46,0,0,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,
+48,20,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1,0,14,109,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,
+18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,
+59,122,0,18,109,0,16,8,48,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,
+48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,49,0,
+57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,
+0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,1,0,
+0,2,3,1,0,2,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,12,2,21,1,1,
+0,12,118,0,0,1,1,0,15,109,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,
+120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,
+0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,8,48,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,
+109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,
+59,122,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,49,0,57,59,119,0,
+48,46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,
+57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,
+0,16,10,50,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,51,0,57,59,120,0,48,18,118,0,59,
+121,0,18,109,0,16,10,51,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,51,0,57,59,122,0,48,
+46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,
+0,15,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,9,2,27,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,
+1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,99,0,0,18,98,0,0,0,4,102,
+108,111,97,116,95,97,100,100,0,18,99,0,0,18,97,0,0,18,99,0,0,0,8,18,99,0,0,0,1,0,5,2,26,1,1,0,5,97,
+0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,111,
+95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,
+121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,97,100,100,0,18,120,0,0,18,120,0,0,18,121,0,0,0,4,102,
+108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,27,1,1,0,5,
+97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,
+111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,
+0,18,121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,121,0,0,18,121,0,0,0,
+4,102,108,111,97,116,95,97,100,100,0,18,120,0,0,18,120,0,0,18,121,0,0,0,4,102,108,111,97,116,95,
+116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,21,1,1,0,5,97,0,0,1,1,0,5,98,
+0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,111,95,102,108,111,
+97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,121,0,0,18,98,
+0,0,0,4,102,108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,120,0,0,18,121,0,0,0,
+4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,22,1,
+1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,
+95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,
+97,116,0,18,121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,100,105,118,105,100,101,0,18,120,0,0,18,
+120,0,0,18,121,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,
+99,0,0,0,1,0,10,2,26,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,
+18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,
+1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,
+0,18,117,0,59,121,0,47,0,0,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,
+50,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,
+10,2,22,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,
+120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,11,
+117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,
+0,59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,1,1,0,
+11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,
+117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,0,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,
+1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,
+18,117,0,59,121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,11,2,22,1,1,0,11,118,0,0,
+1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,
+0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,12,2,26,1,1,0,12,118,0,
+0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,
+121,0,18,117,0,59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,
+59,119,0,46,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,
+0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,
+117,0,59,122,0,47,0,18,118,0,59,119,0,18,117,0,59,119,0,47,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,
+1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,
+18,117,0,59,121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,
+0,48,0,0,0,0,1,0,12,2,22,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,
+120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,
+59,122,0,49,0,18,118,0,59,119,0,18,117,0,59,119,0,49,0,0,0,0,1,0,6,2,26,1,1,0,6,118,0,0,1,1,0,6,
+117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,
+117,0,59,121,0,46,0,0,0,0,1,0,6,2,27,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,
+18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,0,0,0,1,0,6,2,21,
+1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,
+48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,6,2,22,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,
+8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,
+121,0,49,0,0,0,0,1,0,7,2,26,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,
+59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,118,0,59,122,0,18,117,
+0,59,122,0,46,0,0,0,0,1,0,7,2,27,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,
+118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,
+18,117,0,59,122,0,47,0,0,0,0,1,0,7,2,21,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,
+0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,18,118,0,59,
+122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,7,2,22,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,
+99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,
+59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,8,2,26,1,1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,
+101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,
+118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,59,119,0,46,0,0,0,0,1,0,8,2,27,1,
+1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,47,
+0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,18,118,0,59,
+119,0,18,117,0,59,119,0,47,0,0,0,0,1,0,8,2,21,1,1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,
+99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,18,118,0,
+59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,0,48,0,0,0,0,1,0,8,2,22,1,1,0,8,
+118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,
+118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,18,118,0,59,119,0,
+18,117,0,59,119,0,49,0,0,0,0,1,0,13,2,26,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,
+0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,
+46,0,0,0,0,1,0,13,2,27,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,
+0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,13,2,
+22,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,
+48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,14,2,26,1,1,0,14,109,0,0,
+1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,
+0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,
+0,1,0,14,2,27,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,
+110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,
+18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,
+116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
+0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,
+1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,
+16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,
+109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,27,1,1,0,15,109,0,0,1,1,0,15,110,0,
+0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,
+18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,
+57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,15,2,22,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,
+116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
+0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,
+51,0,57,49,0,0,0,0,1,0,10,2,26,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,
+117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,0,0,0,1,0,10,2,26,1,1,0,10,118,0,0,1,1,0,9,98,0,
+0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,0,0,0,1,0,
+10,2,27,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,47,0,18,
+97,0,18,117,0,59,121,0,47,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,
+50,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,0,0,0,1,0,10,2,21,1,1,0,9,97,0,
+0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,
+0,48,0,0,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,
+0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,0,0,0,1,0,10,2,22,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,
+1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,0,0,0,1,0,10,
+2,22,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,49,0,18,
+118,0,59,121,0,18,98,0,49,0,0,0,0,1,0,11,2,26,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,
+51,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,117,0,59,122,0,46,0,
+0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,
+0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,0,18,98,0,46,0,0,0,0,1,0,11,2,27,1,1,0,9,97,
+0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,47,0,18,97,0,18,117,0,59,
+121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,
+58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,118,0,59,122,0,
+18,98,0,47,0,0,0,0,1,0,11,2,21,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,
+117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,18,97,0,18,117,0,59,122,0,48,0,0,0,0,1,0,11,2,
+21,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,48,0,18,118,
+0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,0,0,0,0,1,0,11,2,22,1,1,0,9,97,0,0,1,1,0,11,
+117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,18,
+97,0,18,117,0,59,122,0,49,0,0,0,0,1,0,11,2,22,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,
+51,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,
+0,0,0,1,0,12,2,26,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,59,120,
+0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,117,0,59,122,0,46,0,18,97,0,18,117,0,59,119,0,46,
+0,0,0,0,1,0,12,2,26,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,
+98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,0,18,98,0,46,0,18,118,0,59,119,0,18,98,0,
+46,0,0,0,0,1,0,12,2,27,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,
+59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,18,97,0,18,117,0,59,
+119,0,47,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,
+120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,118,0,59,122,0,18,98,0,47,0,18,118,0,59,119,0,
+18,98,0,47,0,0,0,0,1,0,12,2,21,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,
+117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,18,97,0,18,117,0,59,122,0,48,0,18,97,0,18,117,0,
+59,119,0,48,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,
+59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,0,18,118,0,59,
+119,0,18,98,0,48,0,0,0,0,1,0,12,2,22,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,
+97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,18,97,0,18,117,0,59,122,0,49,0,18,97,0,
+18,117,0,59,119,0,49,0,0,0,0,1,0,12,2,22,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,
+18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,18,
+118,0,59,119,0,18,98,0,49,0,0,0,0,1,0,13,2,26,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,13,2,26,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,
+16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,13,2,27,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,13,2,27,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,
+16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,13,2,21,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,13,2,21,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,
+16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,13,2,22,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,13,2,22,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,
+16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,14,2,26,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,
+51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,
+50,0,57,46,0,0,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,
+16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,
+0,0,0,1,0,14,2,27,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,
+48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,14,
+2,27,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,
+18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,14,2,21,1,1,0,9,
+97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,
+0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,
+9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,
+0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,0,0,0,1,0,14,2,22,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,
+58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,97,0,
+18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,
+51,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,
+18,98,0,49,0,0,0,0,1,0,15,2,26,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,
+110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,
+97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,
+116,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,
+0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,15,2,27,1,1,0,9,97,0,0,1,1,0,15,
+110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,
+47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,15,2,27,1,1,
+0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,
+16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,
+0,0,0,1,0,15,2,21,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,
+48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,18,97,0,18,
+110,0,16,10,51,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,
+0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,
+98,0,48,0,18,109,0,16,10,51,0,57,18,98,0,48,0,0,0,0,1,0,15,2,22,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,
+1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,
+97,0,18,110,0,16,10,50,0,57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,15,2,22,1,1,0,15,
+109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,
+49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,18,109,0,16,10,51,0,57,18,98,0,49,0,0,0,0,
+1,0,6,2,26,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,46,0,0,
+1,0,6,2,26,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,46,0,0,
+1,0,6,2,27,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,47,0,0,
+1,0,6,2,27,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,47,0,0,
+1,0,6,2,21,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,48,0,0,
+1,0,6,2,21,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,48,0,0,
+1,0,6,2,22,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,49,0,0,
+1,0,6,2,22,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,49,0,0,
+1,0,7,2,26,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,46,0,0,
+1,0,7,2,26,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,46,0,0,
+1,0,7,2,27,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,47,0,0,
+1,0,7,2,27,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,47,0,0,
+1,0,7,2,21,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,48,0,0,
+1,0,7,2,21,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,48,0,0,
+1,0,7,2,22,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,49,0,0,
+1,0,7,2,22,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,49,0,0,
+1,0,8,2,26,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,46,0,0,
+1,0,8,2,26,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,46,0,0,
+1,0,8,2,27,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,47,0,0,
+1,0,8,2,27,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,47,0,0,
+1,0,8,2,21,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,48,0,0,
+1,0,8,2,21,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,48,0,0,
+1,0,8,2,22,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,49,0,0,
+1,0,8,2,22,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,49,0,0,
+1,0,10,2,27,1,1,0,10,118,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,
+0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,54,0,18,118,0,59,
+121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,0,1,8,58,118,101,99,52,0,18,
+118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,
+6,2,27,1,1,0,6,118,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,
+0,0,0,1,0,7,2,27,1,1,0,7,118,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,54,0,18,118,0,59,
+121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,8,2,27,1,1,0,8,118,0,0,0,1,8,58,105,118,101,99,52,0,18,
+118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,
+13,2,27,1,1,0,13,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,
+57,54,0,0,0,0,1,0,14,2,27,1,1,0,14,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,54,0,18,
+109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,15,2,27,1,1,0,15,109,0,0,0,1,8,58,
+109,97,116,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,
+18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,9,97,0,0,0,1,9,18,97,0,17,49,0,48,0,0,22,0,0,1,
+0,0,2,25,1,0,2,5,97,0,0,0,1,9,18,97,0,16,10,49,0,22,0,0,1,0,0,2,25,1,0,2,10,118,0,0,0,1,9,18,118,0,
+59,120,0,52,0,9,18,118,0,59,121,0,52,0,0,1,0,0,2,25,1,0,2,11,118,0,0,0,1,9,18,118,0,59,120,0,52,0,
+9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,0,1,0,0,2,25,1,0,2,12,118,0,0,0,1,9,18,118,0,59,
+120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,9,18,118,0,59,119,0,52,0,0,1,0,0,2,25,
+1,0,2,6,118,0,0,0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,0,1,0,0,2,25,1,0,2,7,118,0,0,
+0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,0,1,0,0,2,25,1,0,2,
+8,118,0,0,0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,9,18,118,
+0,59,119,0,52,0,0,1,0,0,2,25,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,
+0,57,52,0,0,1,0,0,2,25,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,
+52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,
+9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,
+2,24,1,0,2,9,97,0,0,0,1,9,18,97,0,17,49,0,48,0,0,21,0,0,1,0,0,2,24,1,0,2,5,97,0,0,0,1,9,18,97,0,16,
+10,49,0,21,0,0,1,0,0,2,24,1,0,2,10,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,0,
+1,0,0,2,24,1,0,2,11,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,9,18,118,0,59,
+122,0,51,0,0,1,0,0,2,24,1,0,2,12,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,9,
+18,118,0,59,122,0,51,0,9,18,118,0,59,119,0,51,0,0,1,0,0,2,24,1,0,2,6,118,0,0,0,1,9,18,118,0,59,120,
+0,51,0,9,18,118,0,59,121,0,51,0,0,1,0,0,2,24,1,0,2,7,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,
+0,59,121,0,51,0,9,18,118,0,59,122,0,51,0,0,1,0,0,2,24,1,0,2,8,118,0,0,0,1,9,18,118,0,59,120,0,51,0,
+9,18,118,0,59,121,0,51,0,9,18,118,0,59,122,0,51,0,9,18,118,0,59,119,0,51,0,0,1,0,0,2,24,1,0,2,13,
+109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,0,0,2,24,1,0,2,14,109,0,
+0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,
+0,0,2,24,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,
+0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,1,0,9,2,25,1,0,2,9,97,0,0,1,1,0,5,0,0,0,1,3,2,
+0,9,1,98,0,2,18,97,0,0,0,9,18,97,0,52,0,8,18,98,0,0,0,1,0,5,2,25,1,0,2,5,97,0,0,1,1,0,5,0,0,0,1,3,
+2,0,5,1,98,0,2,18,97,0,0,0,9,18,97,0,52,0,8,18,98,0,0,0,1,0,10,2,25,1,0,2,10,118,0,0,1,1,0,5,0,0,0,
+1,8,58,118,101,99,50,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,0,0,0,1,0,11,2,25,1,0,2,11,
+118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,
+0,59,122,0,61,0,0,0,0,1,0,12,2,25,1,0,2,12,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,52,0,18,118,0,
+59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,18,118,0,59,119,0,61,0,0,0,0,1,0,6,2,
+25,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,61,0,18,118,0,59,121,
+0,61,0,0,0,0,1,0,7,2,25,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,
+61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,0,0,0,1,0,8,2,25,1,0,2,8,118,0,0,1,1,0,5,0,0,0,
+1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,18,
+118,0,59,119,0,61,0,0,0,0,1,0,13,2,25,1,0,2,13,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,0,18,109,
+0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,0,0,0,1,0,14,2,25,1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,
+8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,
+61,0,0,0,0,1,0,15,2,25,1,0,2,15,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,
+61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0,18,109,0,16,10,51,0,57,61,0,0,0,0,1,0,
+9,2,24,1,0,2,9,97,0,0,1,1,0,5,0,0,0,1,3,2,0,9,1,98,0,2,18,97,0,0,0,9,18,97,0,51,0,8,18,98,0,0,0,1,
+0,5,2,24,1,0,2,5,97,0,0,1,1,0,5,0,0,0,1,3,2,0,5,1,98,0,2,18,97,0,0,0,9,18,97,0,51,0,8,18,98,0,0,0,
+1,0,10,2,24,1,0,2,10,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,60,0,18,118,0,
+59,121,0,60,0,0,0,0,1,0,11,2,24,1,0,2,11,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,
+120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,0,0,0,1,0,12,2,24,1,0,2,12,118,0,0,1,1,0,
+5,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,
+0,18,118,0,59,119,0,60,0,0,0,0,1,0,6,2,24,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,
+18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,0,0,0,1,0,7,2,24,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,
+58,105,118,101,99,51,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,0,0,0,
+1,0,8,2,24,1,0,2,8,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,60,0,18,118,
+0,59,121,0,60,0,18,118,0,59,122,0,60,0,18,118,0,59,119,0,60,0,0,0,0,1,0,13,2,24,1,0,2,13,109,0,0,1,
+1,0,5,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,0,0,0,1,
+0,14,2,24,1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,60,0,18,109,
+0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,0,0,0,1,0,15,2,24,1,0,2,15,109,0,0,1,1,0,5,0,0,0,
+1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,
+57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,1,0,1,2,15,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,
+99,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,1,
+0,1,2,15,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,
+116,0,18,98,0,0,0,40,0,0,1,0,1,2,16,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,99,0,0,0,4,102,108,
+111,97,116,95,108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,0,1,2,16,1,1,0,5,
+97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,
+0,41,0,0,1,0,1,2,18,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,
+111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,101,113,
+117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,18,1,1,0,5,97,0,0,
+1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,43,0,
+0,1,0,1,2,17,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,
+116,95,108,101,115,115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,
+108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,17,1,1,0,5,97,0,0,1,1,0,
+5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,42,0,0,1,0,
+1,2,11,1,1,0,1,97,0,0,1,1,0,1,98,0,0,0,1,8,18,97,0,18,98,0,39,0,0,1,0,1,2,29,1,1,0,1,97,0,0,0,1,8,
+18,97,0,15,2,48,0,38,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,9,102,0,0,0,1,4,102,108,111,97,116,95,
+112,114,105,110,116,0,18,102,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,5,105,0,0,0,1,4,105,110,
+116,95,112,114,105,110,116,0,18,105,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,1,98,0,0,0,1,4,98,
+111,111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,10,118,0,0,
+0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,
+0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,11,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,
+59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,
+118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,12,118,0,0,0,1,9,58,112,114,105,110,116,
+0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,
+116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,
+105,110,116,0,1,1,0,6,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,
+105,110,116,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,7,118,0,0,0,1,9,58,112,
+114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,
+112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,8,118,0,0,0,1,
+9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,
+0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,119,
+0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,2,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,
+120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,
+0,3,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,
+118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,
+116,0,1,1,0,4,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,
+116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,
+110,116,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,13,109,0,0,0,1,9,58,112,
+114,105,110,116,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,
+0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,14,109,0,0,0,1,9,58,112,114,105,110,116,0,18,109,0,16,8,
+48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,0,
+18,109,0,16,10,50,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,15,109,0,0,0,1,9,58,112,114,105,
+110,116,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,0,0,9,58,
+112,114,105,110,116,0,18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,51,0,
+57,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,16,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,
+0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,17,101,0,0,0,1,4,105,110,116,95,112,114,105,
+110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,18,101,0,0,0,1,4,105,110,116,95,112,
+114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,19,101,0,0,0,1,4,105,110,116,
+95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,20,101,0,0,0,1,4,105,
+110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,21,101,0,0,0,1,
+4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
//
// TODO:
// 8.7 Texture Lookup Functions
//
-vec4 texture1D (sampler1D sampler, float coord, float bias) {\r
- vec4 texel;\r
- __asm vec4_tex1d texel, sampler, coord, bias;\r
+vec4 texture1D (sampler1D sampler, float coord, float bias) {
+ vec4 texel;
+ __asm vec4_tex1d texel, sampler, coord, bias;
return texel;
-}\r
+}
vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias) {
return texture1D (sampler, coord.s / coord.t, bias);
-}\r
+}
vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias) {
return texture1D (sampler, coord.s / coord.q, bias);
}
-vec4 texture2D (sampler2D sampler, vec2 coord, float bias) {\r
- vec4 texel;\r
- __asm vec4_tex2d texel, sampler, coord, bias;\r
+vec4 texture2D (sampler2D sampler, vec2 coord, float bias) {
+ vec4 texel;
+ __asm vec4_tex2d texel, sampler, coord, bias;
return texel;
-}\r
+}
-vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias) {\r
+vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias) {
return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p), bias);
-}\r
+}
-vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias) {\r
+vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias) {
return texture2D (sampler, vec2 (coord.s / coord.q, coord.t / coord.q), bias);
}
-vec4 texture3D (sampler3D sampler, vec3 coord, float bias) {\r
- vec4 texel;\r
- __asm vec4_tex3d texel, sampler, coord, bias;\r
+vec4 texture3D (sampler3D sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_tex3d texel, sampler, coord, bias;
return texel;
-}\r
+}
-vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias) {\r
+vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias) {
return texture3D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), bias);
}
-vec4 textureCube (samplerCube sampler, vec3 coord, float bias) {\r
- vec4 texel;\r
- __asm vec4_texcube texel, sampler, coord, bias;\r
+vec4 textureCube (samplerCube sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_texcube texel, sampler, coord, bias;
return texel;
}
-vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias) {\r
- vec4 texel;\r
- __asm vec4_shad1d texel, sampler, coord, bias;\r
+vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_shad1d texel, sampler, coord, bias;
return texel;
-}\r
-
-vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias) {\r
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), bias);\r
-}\r
-\r
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias) {\r
- vec4 texel;\r
- __asm vec4_shad2d texel, sampler, coord, bias;\r
+}
+
+vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias) {
+ return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), bias);
+}
+
+vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_shad2d texel, sampler, coord, bias;
return texel;
-}\r
+}
-vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias) {\r
+vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias) {
return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), bias);
}
// 8.8 Fragment Processing Functions
//
-float dFdx (float p) {\r
+float dFdx (float p) {
// XXX:
return 0.001;
}
-vec2 dFdx (vec2 p) {\r
+vec2 dFdx (vec2 p) {
// XXX:
return vec2 (0.001);
}
-vec3 dFdx (vec3 p) {\r
+vec3 dFdx (vec3 p) {
// XXX:
return vec3 (0.001);
}
-vec4 dFdx (vec4 p) {\r
+vec4 dFdx (vec4 p) {
// XXX:
return vec4 (0.001);
}
-float dFdy (float p) {\r
+float dFdy (float p) {
// XXX:
return 0.001;
}
-vec2 dFdy (vec2 p) {\r
+vec2 dFdy (vec2 p) {
// XXX:
return vec2 (0.001);
}
-vec3 dFdy (vec3 p) {\r
+vec3 dFdy (vec3 p) {
// XXX:
return vec3 (0.001);
}
-vec4 dFdy (vec4 p) {\r
+vec4 dFdy (vec4 p) {
// XXX:
return vec4 (0.001);
}
float fwidth (float p) {
return abs (dFdx (p)) + abs (dFdy (p));
-}\r
+}
vec2 fwidth (vec2 p) {
return abs (dFdx (p)) + abs (dFdy (p));
-}\r
+}
vec3 fwidth (vec3 p) {
return abs (dFdx (p)) + abs (dFdy (p));
-}\r
+}
vec4 fwidth (vec4 p) {
return abs (dFdx (p)) + abs (dFdy (p));
-\r
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\r
-/* slang_fragment_builtin.gc */\r
-\r
-3,2,2,6,12,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,6,1,1,103,108,95,70,114,111,110,\r
-116,70,97,99,105,110,103,0,0,0,2,2,5,12,1,103,108,95,70,114,97,103,67,111,108,111,114,0,0,0,2,2,5,\r
-12,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108,95,77,97,120,68,114,97,119,66,117,102,\r
-102,101,114,115,0,0,0,2,2,5,9,1,103,108,95,70,114,97,103,68,101,112,116,104,0,0,0,2,2,3,12,1,103,\r
-108,95,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,\r
-111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,\r
-101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,\r
-67,111,111,114,100,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,\r
-101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,\r
-101,108,0,0,0,4,118,101,99,52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,\r
-108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,\r
-0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,\r
-1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,49,\r
-68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,\r
-116,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,\r
-1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,\r
-0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,\r
-100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,\r
-120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,\r
-0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,\r
-120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,\r
-0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,\r
-80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,\r
-98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,\r
-58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,\r
-111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,\r
-0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,\r
-1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,\r
-68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,\r
-111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,\r
-49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,\r
-109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,\r
-116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,\r
-115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,\r
-101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,\r
-108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,\r
-117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,\r
-59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,\r
-100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,\r
-98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,\r
-112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,\r
-101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,\r
-115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,\r
-101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,\r
-0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,\r
-118,101,99,52,95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,\r
-0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,\r
-104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,\r
-111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,109,\r
-112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,\r
-113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,\r
-0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,108,\r
-101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,\r
-101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,\r
-112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,\r
-0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,\r
-0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,\r
-115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,\r
-114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,\r
-99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,\r
-1,0,9,0,100,70,100,120,0,1,0,0,9,112,0,0,0,1,8,17,48,0,48,48,49,0,0,0,0,1,0,10,0,100,70,100,120,0,\r
-1,0,0,10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,11,0,100,70,100,120,0,1,\r
-0,0,11,112,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,12,0,100,70,100,120,0,1,0,\r
-0,12,112,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,9,0,100,70,100,121,0,1,0,0,\r
-9,112,0,0,0,1,8,17,48,0,48,48,49,0,0,0,0,1,0,10,0,100,70,100,121,0,1,0,0,10,112,0,0,0,1,8,58,118,\r
-101,99,50,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,11,0,100,70,100,121,0,1,0,0,11,112,0,0,0,1,8,58,118,\r
-101,99,51,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,12,0,100,70,100,121,0,1,0,0,12,112,0,0,0,1,8,58,118,\r
-101,99,52,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,9,0,102,119,105,100,116,104,0,1,0,0,9,112,0,0,0,1,8,\r
-58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,\r
-0,0,0,46,0,0,1,0,10,0,102,119,105,100,116,104,0,1,0,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,\r
-100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102,\r
-119,105,100,116,104,0,1,0,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,\r
-58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,12,0,102,119,105,100,116,104,0,1,0,\r
-0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,\r
-100,121,0,18,112,0,0,0,0,0,46,0,0,0\r
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_fragment_builtin.gc */
+
+3,2,2,6,12,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,6,1,1,103,108,95,70,114,111,110,
+116,70,97,99,105,110,103,0,0,0,2,2,5,12,1,103,108,95,70,114,97,103,67,111,108,111,114,0,0,0,2,2,5,
+12,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108,95,77,97,120,68,114,97,119,66,117,102,
+102,101,114,115,0,0,0,2,2,5,9,1,103,108,95,70,114,97,103,68,101,112,116,104,0,0,0,2,2,3,12,1,103,
+108,95,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,
+111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,
+101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,
+67,111,111,114,100,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,
+101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,
+101,108,0,0,0,4,118,101,99,52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,
+108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,
+0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,
+1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,49,
+68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
+116,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,
+1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,
+0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
+100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,
+120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,
+0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,
+120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,
+0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,
+80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,
+98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,
+58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,
+111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,
+0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,
+1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,
+68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,
+111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,
+49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,
+109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,
+116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,
+101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,
+108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,
+117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,
+59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,
+100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,
+98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,
+112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,
+101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,
+101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,
+0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,
+118,101,99,52,95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,
+0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,
+104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,
+111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,109,
+112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
+113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,
+0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,108,
+101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,
+101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,
+112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,
+0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,
+0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,
+115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,
+114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,
+99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,
+1,0,9,0,100,70,100,120,0,1,0,0,9,112,0,0,0,1,8,17,48,0,48,48,49,0,0,0,0,1,0,10,0,100,70,100,120,0,
+1,0,0,10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,11,0,100,70,100,120,0,1,
+0,0,11,112,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,12,0,100,70,100,120,0,1,0,
+0,12,112,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,9,0,100,70,100,121,0,1,0,0,
+9,112,0,0,0,1,8,17,48,0,48,48,49,0,0,0,0,1,0,10,0,100,70,100,121,0,1,0,0,10,112,0,0,0,1,8,58,118,
+101,99,50,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,11,0,100,70,100,121,0,1,0,0,11,112,0,0,0,1,8,58,118,
+101,99,51,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,12,0,100,70,100,121,0,1,0,0,12,112,0,0,0,1,8,58,118,
+101,99,52,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,9,0,102,119,105,100,116,104,0,1,0,0,9,112,0,0,0,1,8,
+58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,
+0,0,0,46,0,0,1,0,10,0,102,119,105,100,116,104,0,1,0,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,
+100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102,
+119,105,100,116,104,0,1,0,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,
+58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,12,0,102,119,105,100,116,104,0,1,0,
+0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,
+100,121,0,18,112,0,0,0,0,0,46,0,0,0
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2004-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/*\r
- * \file slang_shader.syn\r
- * slang vertex/fragment shader syntax\r
- * \author Michal Krol\r
- */\r
-\r
-/*\r
- * usage:\r
- * syn2c slang_shader.syn > slang_shader_syn.h\r
- *\r
- * when modifying or extending this file, several things must be taken into consideration:\r
- * - when adding new operators that were marked as reserved in the initial specification,\r
- * one must only uncomment particular lines of code that refer to operators being added;\r
- * - when adding new shader target, one must reserve new value for shader_type register and\r
- * use it in .if constructs for symbols that are exclusive for that shader;\r
- * - some symbols mimic output of other symbols - the best example is the "for" construct:\r
- * expression "for (foo(); ; bar())" is seen as "for (foo(); true; bar())" by the output\r
- * processor - hence, special care must be taken when rearranging output of essential symbols;\r
- * - order of single-quoted tokens does matter in alternatives - so do not parse "<" operator\r
- * before "<<" and "<<" before "<<=";\r
- * - all double-quoted tokens are internally preprocessed to eliminate problems with parsing\r
- * strings that are prefixes of other strings, like "sampler1D" and "sampler1DShadow";\r
- */\r
-\r
-.syntax translation_unit;\r
-\r
-/* revision number - increment after each change affecting emitted output */\r
-.emtcode REVISION 3\r
-\r
-/* external declaration */\r
-.emtcode EXTERNAL_NULL 0\r
-.emtcode EXTERNAL_FUNCTION_DEFINITION 1\r
-.emtcode EXTERNAL_DECLARATION 2\r
-\r
-/* declaration */\r
-.emtcode DECLARATION_FUNCTION_PROTOTYPE 1\r
-.emtcode DECLARATION_INIT_DECLARATOR_LIST 2\r
-\r
-/* function type */\r
-.emtcode FUNCTION_ORDINARY 0\r
-.emtcode FUNCTION_CONSTRUCTOR 1\r
-.emtcode FUNCTION_OPERATOR 2\r
-\r
-/* operator type */\r
-.emtcode OPERATOR_ADDASSIGN 1\r
-.emtcode OPERATOR_SUBASSIGN 2\r
-.emtcode OPERATOR_MULASSIGN 3\r
-.emtcode OPERATOR_DIVASSIGN 4\r
-/*.emtcode OPERATOR_MODASSIGN 5*/\r
-/*.emtcode OPERATOR_LSHASSIGN 6*/\r
-/*.emtcode OPERATOR_RSHASSIGN 7*/\r
-/*.emtcode OPERATOR_ORASSIGN 8*/\r
-/*.emtcode OPERATOR_XORASSIGN 9*/\r
-/*.emtcode OPERATOR_ANDASSIGN 10*/\r
-.emtcode OPERATOR_LOGICALXOR 11\r
-/*.emtcode OPERATOR_BITOR 12*/\r
-/*.emtcode OPERATOR_BITXOR 13*/\r
-/*.emtcode OPERATOR_BITAND 14*/\r
-.emtcode OPERATOR_LESS 15\r
-.emtcode OPERATOR_GREATER 16\r
-.emtcode OPERATOR_LESSEQUAL 17\r
-.emtcode OPERATOR_GREATEREQUAL 18\r
-/*.emtcode OPERATOR_LSHIFT 19*/\r
-/*.emtcode OPERATOR_RSHIFT 20*/\r
-.emtcode OPERATOR_MULTIPLY 21\r
-.emtcode OPERATOR_DIVIDE 22\r
-/*.emtcode OPERATOR_MODULUS 23*/\r
-.emtcode OPERATOR_INCREMENT 24\r
-.emtcode OPERATOR_DECREMENT 25\r
-.emtcode OPERATOR_PLUS 26\r
-.emtcode OPERATOR_MINUS 27\r
-/*.emtcode OPERATOR_COMPLEMENT 28*/\r
-.emtcode OPERATOR_NOT 29\r
-\r
-/* init declarator list */\r
-.emtcode DECLARATOR_NONE 0\r
-.emtcode DECLARATOR_NEXT 1\r
-\r
-/* variable declaration */\r
-.emtcode VARIABLE_NONE 0\r
-.emtcode VARIABLE_IDENTIFIER 1\r
-.emtcode VARIABLE_INITIALIZER 2\r
-.emtcode VARIABLE_ARRAY_EXPLICIT 3\r
-.emtcode VARIABLE_ARRAY_UNKNOWN 4\r
-\r
-/* type qualifier */\r
-.emtcode TYPE_QUALIFIER_NONE 0\r
-.emtcode TYPE_QUALIFIER_CONST 1\r
-.emtcode TYPE_QUALIFIER_ATTRIBUTE 2\r
-.emtcode TYPE_QUALIFIER_VARYING 3\r
-.emtcode TYPE_QUALIFIER_UNIFORM 4\r
-.emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5\r
-.emtcode TYPE_QUALIFIER_FIXEDINPUT 6\r
-\r
-/* type specifier */\r
-.emtcode TYPE_SPECIFIER_VOID 0\r
-.emtcode TYPE_SPECIFIER_BOOL 1\r
-.emtcode TYPE_SPECIFIER_BVEC2 2\r
-.emtcode TYPE_SPECIFIER_BVEC3 3\r
-.emtcode TYPE_SPECIFIER_BVEC4 4\r
-.emtcode TYPE_SPECIFIER_INT 5\r
-.emtcode TYPE_SPECIFIER_IVEC2 6\r
-.emtcode TYPE_SPECIFIER_IVEC3 7\r
-.emtcode TYPE_SPECIFIER_IVEC4 8\r
-.emtcode TYPE_SPECIFIER_FLOAT 9\r
-.emtcode TYPE_SPECIFIER_VEC2 10\r
-.emtcode TYPE_SPECIFIER_VEC3 11\r
-.emtcode TYPE_SPECIFIER_VEC4 12\r
-.emtcode TYPE_SPECIFIER_MAT2 13\r
-.emtcode TYPE_SPECIFIER_MAT3 14\r
-.emtcode TYPE_SPECIFIER_MAT4 15\r
-.emtcode TYPE_SPECIFIER_SAMPLER1D 16\r
-.emtcode TYPE_SPECIFIER_SAMPLER2D 17\r
-.emtcode TYPE_SPECIFIER_SAMPLER3D 18\r
-.emtcode TYPE_SPECIFIER_SAMPLERCUBE 19\r
-.emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20\r
-.emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21\r
-.emtcode TYPE_SPECIFIER_STRUCT 22\r
-.emtcode TYPE_SPECIFIER_TYPENAME 23\r
-\r
-/* structure field */\r
-.emtcode FIELD_NONE 0\r
-.emtcode FIELD_NEXT 1\r
-.emtcode FIELD_ARRAY 2\r
-\r
-/* operation */\r
-.emtcode OP_END 0\r
-.emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1\r
-.emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2\r
-.emtcode OP_DECLARE 3\r
-.emtcode OP_ASM 4\r
-.emtcode OP_BREAK 5\r
-.emtcode OP_CONTINUE 6\r
-.emtcode OP_DISCARD 7\r
-.emtcode OP_RETURN 8\r
-.emtcode OP_EXPRESSION 9\r
-.emtcode OP_IF 10\r
-.emtcode OP_WHILE 11\r
-.emtcode OP_DO 12\r
-.emtcode OP_FOR 13\r
-.emtcode OP_PUSH_VOID 14\r
-.emtcode OP_PUSH_BOOL 15\r
-.emtcode OP_PUSH_INT 16\r
-.emtcode OP_PUSH_FLOAT 17\r
-.emtcode OP_PUSH_IDENTIFIER 18\r
-.emtcode OP_SEQUENCE 19\r
-.emtcode OP_ASSIGN 20\r
-.emtcode OP_ADDASSIGN 21\r
-.emtcode OP_SUBASSIGN 22\r
-.emtcode OP_MULASSIGN 23\r
-.emtcode OP_DIVASSIGN 24\r
-/*.emtcode OP_MODASSIGN 25*/\r
-/*.emtcode OP_LSHASSIGN 26*/\r
-/*.emtcode OP_RSHASSIGN 27*/\r
-/*.emtcode OP_ORASSIGN 28*/\r
-/*.emtcode OP_XORASSIGN 29*/\r
-/*.emtcode OP_ANDASSIGN 30*/\r
-.emtcode OP_SELECT 31\r
-.emtcode OP_LOGICALOR 32\r
-.emtcode OP_LOGICALXOR 33\r
-.emtcode OP_LOGICALAND 34\r
-/*.emtcode OP_BITOR 35*/\r
-/*.emtcode OP_BITXOR 36*/\r
-/*.emtcode OP_BITAND 37*/\r
-.emtcode OP_EQUAL 38\r
-.emtcode OP_NOTEQUAL 39\r
-.emtcode OP_LESS 40\r
-.emtcode OP_GREATER 41\r
-.emtcode OP_LESSEQUAL 42\r
-.emtcode OP_GREATEREQUAL 43\r
-/*.emtcode OP_LSHIFT 44*/\r
-/*.emtcode OP_RSHIFT 45*/\r
-.emtcode OP_ADD 46\r
-.emtcode OP_SUBTRACT 47\r
-.emtcode OP_MULTIPLY 48\r
-.emtcode OP_DIVIDE 49\r
-/*.emtcode OP_MODULUS 50*/\r
-.emtcode OP_PREINCREMENT 51\r
-.emtcode OP_PREDECREMENT 52\r
-.emtcode OP_PLUS 53\r
-.emtcode OP_MINUS 54\r
-/*.emtcode OP_COMPLEMENT 55*/\r
-.emtcode OP_NOT 56\r
-.emtcode OP_SUBSCRIPT 57\r
-.emtcode OP_CALL 58\r
-.emtcode OP_FIELD 59\r
-.emtcode OP_POSTINCREMENT 60\r
-.emtcode OP_POSTDECREMENT 61\r
-\r
-/* parameter qualifier */\r
-.emtcode PARAM_QUALIFIER_IN 0\r
-.emtcode PARAM_QUALIFIER_OUT 1\r
-.emtcode PARAM_QUALIFIER_INOUT 2\r
-\r
-/* function parameter */\r
-.emtcode PARAMETER_NONE 0\r
-.emtcode PARAMETER_NEXT 1\r
-\r
-/* function parameter array presence */\r
-.emtcode PARAMETER_ARRAY_NOT_PRESENT 0\r
-.emtcode PARAMETER_ARRAY_PRESENT 1\r
-\r
-.errtext INVALID_EXTERNAL_DECLARATION "error 2001: invalid external declaration"\r
-.errtext INVALID_OPERATOR_OVERRIDE "error 2002: invalid operator override"\r
-.errtext LBRACE_EXPECTED "error 2003: '{' expected but '$err_token$' found"\r
-.errtext LPAREN_EXPECTED "error 2004: '(' expected but '$err_token$' found"\r
-.errtext RPAREN_EXPECTED "error 2005: ')' expected but '$err_token$' found"\r
-\r
-/* tells whether the shader that is being parsed is a built-in shader or not */\r
-/* 0 - normal behaviour */\r
-/* 1 - accepts constructor and operator definitions and __asm statements */\r
-/* the implementation will set it to 1 when compiling internal built-in shaders */\r
-.regbyte parsing_builtin 0\r
-\r
-/* holds the type of the shader being parsed; possible values are listed below */\r
-/* FRAGMENT_SHADER 1 */\r
-/* VERTEX_SHADER 2 */\r
-/* shader type is set by the caller before parsing */\r
-.regbyte shader_type 0\r
-\r
-/*\r
- <variable_identifier> ::= <identifier>\r
-*/\r
-variable_identifier\r
- identifier .emit OP_PUSH_IDENTIFIER;\r
-\r
-/*\r
- <primary_expression> ::= <variable_identifier>\r
- | <intconstant>\r
- | <floatconstant>\r
- | <boolconstant>\r
- | "(" <expression> ")"\r
-*/\r
-primary_expression\r
- floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;\r
-primary_expression_1\r
- lparen .and expression .and rparen;\r
-\r
-/*\r
- <postfix_expression> ::= <primary_expression>\r
- | <postfix_expression> "[" <integer_expression> "]"\r
- | <function_call>\r
- | <postfix_expression> "." <field_selection>\r
- | <postfix_expression> "++"\r
- | <postfix_expression> "--"\r
-*/\r
-postfix_expression\r
- postfix_expression_1 .and .loop postfix_expression_2;\r
-postfix_expression_1\r
- function_call .or primary_expression;\r
-postfix_expression_2\r
- postfix_expression_3 .or postfix_expression_4 .or\r
- plusplus .emit OP_POSTINCREMENT .or\r
- minusminus .emit OP_POSTDECREMENT;\r
-postfix_expression_3\r
- lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;\r
-postfix_expression_4\r
- dot .and field_selection .emit OP_FIELD;\r
-\r
-/*\r
- <integer_expression> ::= <expression>\r
-*/\r
-integer_expression\r
- expression;\r
-\r
-/*\r
- <function_call> ::= <function_call_generic>\r
-*/\r
-function_call\r
- function_call_generic .emit OP_CALL .and .true .emit OP_END;\r
-\r
-/*\r
- <function_call_generic> ::= <function_call_header_with_parameters> ")"\r
- | <function_call_header_no_parameters> ")"\r
-*/\r
-function_call_generic\r
- function_call_generic_1 .or function_call_generic_2;\r
-function_call_generic_1\r
- function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;\r
-function_call_generic_2\r
- function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;\r
-\r
-/*\r
- <function_call_header_no_parameters>::= <function_call_header> "void"\r
- | <function_call_header>\r
-*/\r
-function_call_header_no_parameters\r
- function_call_header .and function_call_header_no_parameters_1;\r
-function_call_header_no_parameters_1\r
- "void" .or .true;\r
-\r
-/*\r
- <function_call_header_with_parameters>::= <function_call_header> <assignment_expression>\r
- | <function_call_header_with_parameters> ","\r
- <assignment_expression>\r
-*/\r
-function_call_header_with_parameters\r
- function_call_header .and assignment_expression .and .true .emit OP_END .and\r
- .loop function_call_header_with_parameters_1;\r
-function_call_header_with_parameters_1\r
- comma .and assignment_expression .and .true .emit OP_END;\r
-\r
-/*\r
- <function_call_header> ::= <function_identifier> "("\r
-*/\r
-function_call_header\r
- function_identifier .and lparen;\r
-\r
-/*\r
- <function_identifier> ::= <constructor_identifier>\r
- | <identifier>\r
-\r
-note: <constructor_identifier> has been deleted\r
-*/\r
-function_identifier\r
- identifier;\r
-\r
-/*\r
- <unary_expression> ::= <postfix_expression>\r
- | "++" <unary_expression>\r
- | "--" <unary_expression>\r
- | <unary_operator> <unary_expression>\r
-\r
- <unary_operator> ::= "+"\r
- | "-"\r
- | "!"\r
- | "~" // reserved\r
-*/\r
-unary_expression\r
- postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\r
- unary_expression_4 .or unary_expression_5/* .or unary_expression_6*/;\r
-unary_expression_1\r
- plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;\r
-unary_expression_2\r
- minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;\r
-unary_expression_3\r
- plus .and unary_expression .and .true .emit OP_PLUS;\r
-unary_expression_4\r
- minus .and unary_expression .and .true .emit OP_MINUS;\r
-unary_expression_5\r
- bang .and unary_expression .and .true .emit OP_NOT;\r
-/*unary_expression_6\r
- tilde .and unary_expression .and .true .emit OP_COMPLEMENT;*/\r
-\r
-/*\r
- <multiplicative_expression> ::= <unary_expression>\r
- | <multiplicative_expression> "*" <unary_expression>\r
- | <multiplicative_expression> "/" <unary_expression>\r
- | <multiplicative_expression> "%" <unary_expression> // reserved\r
-*/\r
-multiplicative_expression\r
- unary_expression .and .loop multiplicative_expression_1;\r
-multiplicative_expression_1\r
- multiplicative_expression_2 .or multiplicative_expression_3/* .or multiplicative_expression_4*/;\r
-multiplicative_expression_2\r
- star .and unary_expression .and .true .emit OP_MULTIPLY;\r
-multiplicative_expression_3\r
- slash .and unary_expression .and .true .emit OP_DIVIDE;\r
-/*multiplicative_expression_4\r
- percent .and unary_expression .and .true .emit OP_MODULUS;*/\r
-\r
-/*\r
- <additive_expression> ::= <multiplicative_expression>\r
- | <additive_expression> "+" <multiplicative_expression>\r
- | <additive_expression> "-" <multiplicative_expression>\r
-*/\r
-additive_expression\r
- multiplicative_expression .and .loop additive_expression_1;\r
-additive_expression_1\r
- additive_expression_2 .or additive_expression_3;\r
-additive_expression_2\r
- plus .and multiplicative_expression .and .true .emit OP_ADD;\r
-additive_expression_3\r
- minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;\r
-\r
-/*\r
- <shift_expression> ::= <additive_expression>\r
- | <shift_expression> "<<" <additive_expression> // reserved\r
- | <shift_expression> ">>" <additive_expression> // reserved\r
-*/\r
-shift_expression\r
- additive_expression/* .and .loop shift_expression_1*/;\r
-/*shift_expression_1\r
- shift_expression_2 .or shift_expression_3;*/\r
-/*shift_expression_2\r
- lessless .and additive_expression .and .true .emit OP_LSHIFT;*/\r
-/*shift_expression_3\r
- greatergreater .and additive_expression .and .true .emit OP_RSHIFT;*/\r
-\r
-/*\r
- <relational_expression> ::= <shift_expression>\r
- | <relational_expression> "<" <shift_expression>\r
- | <relational_expression> ">" <shift_expression>\r
- | <relational_expression> "<=" <shift_expression>\r
- | <relational_expression> ">=" <shift_expression>\r
-*/\r
-relational_expression\r
- shift_expression .and .loop relational_expression_1;\r
-relational_expression_1\r
- relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\r
- relational_expression_5;\r
-relational_expression_2\r
- lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\r
-relational_expression_3\r
- greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\r
-relational_expression_4\r
- less .and shift_expression .and .true .emit OP_LESS;\r
-relational_expression_5\r
- greater .and shift_expression .and .true .emit OP_GREATER;\r
-\r
-/*\r
- <equality_expression> ::= <relational_expression>\r
- | <equality_expression> "==" <relational_expression>\r
- | <equality_expression> "!=" <relational_expression>\r
-*/\r
-equality_expression\r
- relational_expression .and .loop equality_expression_1;\r
-equality_expression_1\r
- equality_expression_2 .or equality_expression_3;\r
-equality_expression_2\r
- equalsequals .and relational_expression .and .true .emit OP_EQUAL;\r
-equality_expression_3\r
- bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\r
-\r
-/*\r
- <and_expression> ::= <equality_expression>\r
- | <and_expression> "&" <equality_expression> // reserved\r
-*/\r
-and_expression\r
- equality_expression/* .and .loop and_expression_1*/;\r
-/*and_expression_1\r
- ampersand .and equality_expression .and .true .emit OP_BITAND;*/\r
-\r
-/*\r
- <exclusive_or_expression> ::= <and_expression>\r
- | <exclusive_or_expression> "^" <and_expression> // reserved\r
-*/\r
-exclusive_or_expression\r
- and_expression/* .and .loop exclusive_or_expression_1*/;\r
-/*exclusive_or_expression_1\r
- caret .and and_expression .and .true .emit OP_BITXOR;*/\r
-\r
-/*\r
- <inclusive_or_expression> ::= <exclusive_or_expression>\r
- | <inclusive_or_expression> "|" <exclusive_or_expression> // reserved\r
-*/\r
-inclusive_or_expression\r
- exclusive_or_expression/* .and .loop inclusive_or_expression_1*/;\r
-/*inclusive_or_expression_1\r
- bar .and exclusive_or_expression .and .true .emit OP_BITOR;*/\r
-\r
-/*\r
- <logical_and_expression> ::= <inclusive_or_expression>\r
- | <logical_and_expression> "&&" <inclusive_or_expression>\r
-*/\r
-logical_and_expression\r
- inclusive_or_expression .and .loop logical_and_expression_1;\r
-logical_and_expression_1\r
- ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;\r
-\r
-/*\r
- <logical_xor_expression> ::= <logical_and_expression>\r
- | <logical_xor_expression> "^^" <logical_and_expression>\r
-*/\r
-logical_xor_expression\r
- logical_and_expression .and .loop logical_xor_expression_1;\r
-logical_xor_expression_1\r
- caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;\r
-\r
-/*\r
- <logical_or_expression> ::= <logical_xor_expression>\r
- | <logical_or_expression> "||" <logical_xor_expression>\r
-*/\r
-logical_or_expression\r
- logical_xor_expression .and .loop logical_or_expression_1;\r
-logical_or_expression_1\r
- barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;\r
-\r
-/*\r
- <conditional_expression> ::= <logical_or_expression>\r
- | <logical_or_expression> "?" <expression> ":"\r
- <conditional_expression>\r
-*/\r
-conditional_expression\r
- logical_or_expression .and .loop conditional_expression_1;\r
-conditional_expression_1\r
- question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;\r
-\r
-/*\r
- <assignment_expression> ::= <conditional_expression>\r
- | <unary_expression> <assignment_operator>\r
- <assignment_expression>\r
-\r
- <assignment_operator> ::= "="\r
- | "*="\r
- | "/="\r
- | "+="\r
- | "-="\r
- | "%=" // reserved\r
- | "<<=" // reserved\r
- | ">>=" // reserved\r
- | "&=" // reserved\r
- | "^=" // reserved\r
- | "|=" // reserved\r
-*/\r
-assignment_expression\r
- assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or\r
- assignment_expression_4 .or assignment_expression_5/* .or assignment_expression_6 .or\r
- assignment_expression_7 .or assignment_expression_8 .or assignment_expression_9 .or\r
- assignment_expression_10 .or assignment_expression_11*/ .or conditional_expression;\r
-assignment_expression_1\r
- unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;\r
-assignment_expression_2\r
- unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;\r
-assignment_expression_3\r
- unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;\r
-assignment_expression_4\r
- unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;\r
-assignment_expression_5\r
- unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;\r
-/*assignment_expression_6\r
- unary_expression .and percentequals .and assignment_expression .and .true .emit OP_MODASSIGN;*/\r
-/*assignment_expression_7\r
- unary_expression .and lesslessequals .and assignment_expression .and .true .emit OP_LSHASSIGN;*/\r
-/*assignment_expression_8\r
- unary_expression .and greatergreaterequals .and assignment_expression .and\r
- .true .emit OP_RSHASSIGN;*/\r
-/*assignment_expression_9\r
- unary_expression .and ampersandequals .and assignment_expression .and .true .emit OP_ANDASSIGN;*/\r
-/*assignment_expression_10\r
- unary_expression .and caretequals .and assignment_expression .and .true .emit OP_XORASSIGN;*/\r
-/*assignment_expression_11\r
- unary_expression .and barequals .and assignment_expression .and .true .emit OP_ORASSIGN;*/\r
-\r
-/*\r
- <expression> ::= <assignment_expression>\r
- | <expression> "," <assignment_expression>\r
-*/\r
-expression\r
- assignment_expression .and .loop expression_1;\r
-expression_1\r
- comma .and assignment_expression .and .true .emit OP_SEQUENCE;\r
-\r
-/*\r
- <constant_expression> ::= <conditional_expression>\r
-*/\r
-constant_expression\r
- conditional_expression .and .true .emit OP_END;\r
-\r
-/*\r
- <declaration> ::= <function_prototype> ";"\r
- | <init_declarator_list> ";"\r
-*/\r
-declaration\r
- declaration_1 .or declaration_2;\r
-declaration_1\r
- function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;\r
-declaration_2\r
- init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\r
-\r
-/*\r
- <function_prototype> ::= <function_header> "void" ")"\r
- | <function_declarator> ")"\r
-*/\r
-function_prototype\r
- function_prototype_1 .or function_prototype_2;\r
-function_prototype_1\r
- function_header .and "void" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\r
-function_prototype_2\r
- function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\r
-\r
-/*\r
- <function_declarator> ::= <function_header>\r
- | <function_header_with_parameters>\r
-*/\r
-function_declarator\r
- function_header_with_parameters .or function_header;\r
-\r
-/*\r
- <function_header_with_parameters> ::= <function_header> <parameter_declaration>\r
- | <function_header_with_parameters> ","\r
- <parameter_declaration>\r
-*/\r
-function_header_with_parameters\r
- function_header .and parameter_declaration .and .loop function_header_with_parameters_1;\r
-function_header_with_parameters_1\r
- comma .and parameter_declaration;\r
-\r
-/*\r
- <function_header> ::= <fully_specified_type> <identifier> "("\r
-*/\r
-function_header\r
- function_header_nospace .or function_header_space;\r
-function_header_space\r
- fully_specified_type_space .and space .and function_decl_identifier .and lparen;\r
-function_header_nospace\r
- fully_specified_type_nospace .and function_decl_identifier .and lparen;\r
-\r
-/*\r
- <function_decl_identifier> ::= "__constructor"\r
- | <__operator>\r
- | <identifier>\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- operator and constructor prototypes and definitions\r
-*/\r
-function_decl_identifier\r
- .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\r
- .if (parsing_builtin != 0) "__constructor" .emit FUNCTION_CONSTRUCTOR .or\r
- identifier .emit FUNCTION_ORDINARY;\r
-\r
-/*\r
- <__operator> ::= "__operator" <overriden_op>\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- operator prototypes and definitions\r
-*/\r
-__operator\r
- "__operator" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;\r
-\r
-/*\r
- <overriden_op> ::= "="\r
- | "+="\r
- | "-="\r
- | "*="\r
- | "/="\r
- | "%=" // reserved\r
- | "<<=" // reserved\r
- | ">>=" // reserved\r
- | "&=" // reserved\r
- | "^=" // reserved\r
- | "|=" // reserved\r
- | "^^"\r
- | "|" // reserved\r
- | "^" // reserved\r
- | "&" // reserved\r
- | "=="\r
- | "!="\r
- | "<"\r
- | ">"\r
- | "<="\r
- | ">="\r
- | "<<" // reserved\r
- | ">>" // reserved\r
- | "*"\r
- | "/"\r
- | "%" // reserved\r
- | "++"\r
- | "--"\r
- | "+"\r
- | "-"\r
- | "~" // reserved\r
- | "!"\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- operator prototypes and definitions\r
-*/\r
-overriden_operator\r
- plusplus .emit OPERATOR_INCREMENT .or\r
- plusequals .emit OPERATOR_ADDASSIGN .or\r
- plus .emit OPERATOR_PLUS .or\r
- minusminus .emit OPERATOR_DECREMENT .or\r
- minusequals .emit OPERATOR_SUBASSIGN .or\r
- minus .emit OPERATOR_MINUS .or\r
- bang .emit OPERATOR_NOT .or\r
- starequals .emit OPERATOR_MULASSIGN .or\r
- star .emit OPERATOR_MULTIPLY .or\r
- slashequals .emit OPERATOR_DIVASSIGN .or\r
- slash .emit OPERATOR_DIVIDE .or\r
- lessequals .emit OPERATOR_LESSEQUAL .or\r
- /*lesslessequals .emit OPERATOR_LSHASSIGN .or*/\r
- /*lessless .emit OPERATOR_LSHIFT .or*/\r
- less .emit OPERATOR_LESS .or\r
- greaterequals .emit OPERATOR_GREATEREQUAL .or\r
- /*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/\r
- /*greatergreater .emit OPERATOR_RSHIFT .or*/\r
- greater .emit OPERATOR_GREATER .or\r
- /*percentequals .emit OPERATOR_MODASSIGN .or*/\r
- /*percent .emit OPERATOR_MODULUS .or*/\r
- /*ampersandequals .emit OPERATOR_ANDASSIGN */\r
- /*ampersand .emit OPERATOR_BITAND .or*/\r
- /*barequals .emit OPERATOR_ORASSIGN .or*/\r
- /*bar .emit OPERATOR_BITOR .or*/\r
- /*tilde .emit OPERATOR_COMPLEMENT .or*/\r
- /*caretequals .emit OPERATOR_XORASSIGN .or*/\r
- caretcaret .emit OPERATOR_LOGICALXOR /*.or\r
- caret .emit OPERATOR_BITXOR*/;\r
-\r
-/*\r
- <parameter_declarator> ::= <type_specifier> <identifier>\r
- | <type_specifier> <identifier> "[" <constant_expression>\r
- "]"\r
-*/\r
-parameter_declarator\r
- parameter_declarator_nospace .or parameter_declarator_space;\r
-parameter_declarator_nospace\r
- type_specifier_nospace .and identifier .and parameter_declarator_1;\r
-parameter_declarator_space\r
- type_specifier_space .and space .and identifier .and parameter_declarator_1;\r
-parameter_declarator_1\r
- parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\r
- .true .emit PARAMETER_ARRAY_NOT_PRESENT;\r
-parameter_declarator_2\r
- lbracket .and constant_expression .and rbracket;\r
-\r
-/*\r
- <parameter_declaration> ::= <type_qualifier> <parameter_qualifier>\r
- <parameter_declarator>\r
- | <type_qualifier> <parameter_qualifier>\r
- <parameter_type_specifier>\r
- | <parameter_qualifier> <parameter_declarator>\r
- | <parameter_qualifier> <parameter_type_specifier>\r
-*/\r
-parameter_declaration\r
- parameter_declaration_1 .emit PARAMETER_NEXT;\r
-parameter_declaration_1\r
- parameter_declaration_2 .or parameter_declaration_3;\r
-parameter_declaration_2\r
- type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;\r
-parameter_declaration_3\r
- parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\r
-parameter_declaration_4\r
- parameter_declarator .or parameter_type_specifier;\r
-\r
-/*\r
- <parameter_qualifier> ::= "in"\r
- | "out"\r
- | "inout"\r
- | ""\r
-*/\r
-parameter_qualifier\r
- parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\r
-parameter_qualifier_1\r
- parameter_qualifier_2 .and space;\r
-parameter_qualifier_2\r
- "in" .emit PARAM_QUALIFIER_IN .or\r
- "out" .emit PARAM_QUALIFIER_OUT .or\r
- "inout" .emit PARAM_QUALIFIER_INOUT;\r
-\r
-/*\r
- <parameter_type_specifier> ::= <type_specifier>\r
- | <type_specifier> "[" <constant_expression> "]"\r
-*/\r
-parameter_type_specifier\r
- parameter_type_specifier_1 .and .true .emit '\0' .and parameter_type_specifier_2;\r
-parameter_type_specifier_1\r
- type_specifier_nospace .or type_specifier_space;\r
-parameter_type_specifier_2\r
- parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\r
- .true .emit PARAMETER_ARRAY_NOT_PRESENT;\r
-parameter_type_specifier_3\r
- lbracket .and constant_expression .and rbracket;\r
-\r
-/*\r
- <init_declarator_list> ::= <single_declaration>\r
- | <init_declarator_list> "," <identifier>\r
- | <init_declarator_list> "," <identifier> "[" "]"\r
- | <init_declarator_list> "," <identifier> "["\r
- <constant_expression> "]"\r
- | <init_declarator_list> "," <identifier> "="\r
- <initializer>\r
-*/\r
-init_declarator_list\r
- single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and\r
- .true .emit DECLARATOR_NONE;\r
-init_declarator_list_1\r
- comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;\r
-init_declarator_list_2\r
- init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;\r
-init_declarator_list_3\r
- equals .and initializer .emit VARIABLE_INITIALIZER;\r
-init_declarator_list_4\r
- lbracket .and init_declarator_list_5 .and rbracket;\r
-init_declarator_list_5\r
- constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\r
-\r
-/*\r
- <single_declaration> ::= <fully_specified_type>\r
- | <fully_specified_type> <identifier>\r
- | <fully_specified_type> <identifier> "[" "]"\r
- | <fully_specified_type> <identifier> "["\r
- <constant_expression> "]"\r
- | <fully_specified_type> <identifier> "=" <initializer>\r
-*/\r
-single_declaration\r
- single_declaration_nospace .or single_declaration_space;\r
-single_declaration_space\r
- fully_specified_type_space .and single_declaration_space_1;\r
-single_declaration_nospace\r
- fully_specified_type_nospace .and single_declaration_nospace_1;\r
-single_declaration_space_1\r
- single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\r
-single_declaration_nospace_1\r
- single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\r
-single_declaration_space_2\r
- space .and identifier .and single_declaration_3;\r
-single_declaration_nospace_2\r
- identifier .and single_declaration_3;\r
-single_declaration_3\r
- single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\r
-single_declaration_4\r
- equals .and initializer .emit VARIABLE_INITIALIZER;\r
-single_declaration_5\r
- lbracket .and single_declaration_6 .and rbracket;\r
-single_declaration_6\r
- constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\r
-\r
-/*\r
- <fully_specified_type> ::= <type_specifier>\r
- | <type_qualifier> <type_specifier>\r
-*/\r
-fully_specified_type_space\r
- fully_specified_type_1 .and type_specifier_space;\r
-fully_specified_type_nospace\r
- fully_specified_type_1 .and type_specifier_nospace;\r
-fully_specified_type_1\r
- fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;\r
-fully_specified_type_2\r
- type_qualifier .and space;\r
-\r
-/*\r
- <type_qualifier> ::= "const"\r
- | "attribute" // Vertex only.\r
- | "varying"\r
- | "uniform"\r
- | "__fixed_output"\r
- | "__fixed_input"\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- __fixed_output and __fixed_input type qualifiers\r
-*/\r
-type_qualifier\r
- "const" .emit TYPE_QUALIFIER_CONST .or\r
- .if (shader_type == 2) "attribute" .emit TYPE_QUALIFIER_ATTRIBUTE .or\r
- "varying" .emit TYPE_QUALIFIER_VARYING .or\r
- "uniform" .emit TYPE_QUALIFIER_UNIFORM .or\r
- .if (parsing_builtin != 0) "__fixed_output" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\r
- .if (parsing_builtin != 0) "__fixed_input" .emit TYPE_QUALIFIER_FIXEDINPUT;\r
-\r
-/*\r
- <type_specifier> ::= "void"\r
- | "float"\r
- | "int"\r
- | "bool"\r
- | "vec2"\r
- | "vec3"\r
- | "vec4"\r
- | "bvec2"\r
- | "bvec3"\r
- | "bvec4"\r
- | "ivec2"\r
- | "ivec3"\r
- | "ivec4"\r
- | "mat2"\r
- | "mat3"\r
- | "mat4"\r
- | "sampler1D"\r
- | "sampler2D"\r
- | "sampler3D"\r
- | "samplerCube"\r
- | "sampler1DShadow"\r
- | "sampler2DShadow"\r
- | <struct_specifier>\r
- | <type_name>\r
-*/\r
-type_specifier_space\r
- "void" .emit TYPE_SPECIFIER_VOID .or\r
- "float" .emit TYPE_SPECIFIER_FLOAT .or\r
- "int" .emit TYPE_SPECIFIER_INT .or\r
- "bool" .emit TYPE_SPECIFIER_BOOL .or\r
- "vec2" .emit TYPE_SPECIFIER_VEC2 .or\r
- "vec3" .emit TYPE_SPECIFIER_VEC3 .or\r
- "vec4" .emit TYPE_SPECIFIER_VEC4 .or\r
- "bvec2" .emit TYPE_SPECIFIER_BVEC2 .or\r
- "bvec3" .emit TYPE_SPECIFIER_BVEC3 .or\r
- "bvec4" .emit TYPE_SPECIFIER_BVEC4 .or\r
- "ivec2" .emit TYPE_SPECIFIER_IVEC2 .or\r
- "ivec3" .emit TYPE_SPECIFIER_IVEC3 .or\r
- "ivec4" .emit TYPE_SPECIFIER_IVEC4 .or\r
- "mat2" .emit TYPE_SPECIFIER_MAT2 .or\r
- "mat3" .emit TYPE_SPECIFIER_MAT3 .or\r
- "mat4" .emit TYPE_SPECIFIER_MAT4 .or\r
- "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or\r
- "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or\r
- "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or\r
- "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\r
- "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\r
- "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\r
- type_name .emit TYPE_SPECIFIER_TYPENAME;\r
-type_specifier_nospace\r
- struct_specifier .emit TYPE_SPECIFIER_STRUCT;\r
-\r
-/*\r
- <struct_specifier> ::= "struct" <identifier> "{" <struct_declaration_list> "}"\r
- | "struct" "{" <struct_declaration_list> "}"\r
-*/\r
-struct_specifier\r
- "struct" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\r
- struct_declaration_list .and rbrace .emit FIELD_NONE;\r
-struct_specifier_1\r
- struct_specifier_2 .or .true .emit '\0';\r
-struct_specifier_2\r
- space .and identifier;\r
-\r
-/*\r
- <struct_declaration_list> ::= <struct_declaration>\r
- | <struct_declaration_list> <struct_declaration>\r
-*/\r
-struct_declaration_list\r
- struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\r
-\r
-/*\r
- <struct_declaration> ::= <type_specifier> <struct_declarator_list> ";"\r
-*/\r
-struct_declaration\r
- struct_declaration_nospace .or struct_declaration_space;\r
-struct_declaration_space\r
- type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;\r
-struct_declaration_nospace\r
- type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;\r
-\r
-/*\r
- <struct_declarator_list> ::= <struct_declarator>\r
- | <struct_declarator_list> "," <struct_declarator>\r
-*/\r
-struct_declarator_list\r
- struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\r
-struct_declarator_list_1\r
- comma .and struct_declarator;\r
-\r
-/*\r
- <struct_declarator> ::= <identifier>\r
- | <identifier> "[" <constant_expression> "]"\r
-*/\r
-struct_declarator\r
- identifier .and struct_declarator_1;\r
-struct_declarator_1\r
- struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;\r
-struct_declarator_2\r
- lbracket .and constant_expression .and rbracket;\r
-\r
-/*\r
- <initializer> ::= <assignment_expression>\r
-*/\r
-initializer\r
- assignment_expression .and .true .emit OP_END;\r
-\r
-/*\r
- <declaration_statement> ::= <declaration>\r
-*/\r
-declaration_statement\r
- declaration;\r
-\r
-/*\r
- <statement> ::= <compound_statement>\r
- | <simple_statement>\r
-*/\r
-statement\r
- compound_statement .or simple_statement;\r
-statement_space\r
- compound_statement .or statement_space_1;\r
-statement_space_1\r
- space .and simple_statement;\r
-\r
-/*\r
- <simple_statement> ::= <__asm_statement>\r
- | <selection_statement>\r
- | <iteration_statement>\r
- | <jump_statement>\r
- | <expression_statement>\r
- | <declaration_statement>\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- use of __asm statements\r
-*/\r
-simple_statement\r
- .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\r
- selection_statement .or\r
- iteration_statement .or\r
- jump_statement .or\r
- expression_statement .emit OP_EXPRESSION .or\r
- declaration_statement .emit OP_DECLARE;\r
-\r
-/*\r
- <compound_statement> ::= "{" "}"\r
- | "{" <statement_list> "}"\r
-*/\r
-compound_statement\r
- compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;\r
-compound_statement_1\r
- compound_statement_2 .or compound_statement_3;\r
-compound_statement_2\r
- lbrace .and rbrace;\r
-compound_statement_3\r
- lbrace .and statement_list .and rbrace;\r
-\r
-/*\r
- <statement_no_new_scope> ::= <compound_statement_no_new_scope>\r
- | <simple_statement>\r
-*/\r
-statement_no_new_scope\r
- compound_statement_no_new_scope .or simple_statement;\r
-\r
-/*\r
- <compound_statement_no_new_scope> ::= "{" "}"\r
- | "{" <statement_list> "}"\r
-*/\r
-compound_statement_no_new_scope\r
- compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\r
-compound_statement_no_new_scope_1\r
- compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;\r
-compound_statement_no_new_scope_2\r
- lbrace .and rbrace;\r
-compound_statement_no_new_scope_3\r
- lbrace .and statement_list .and rbrace;\r
-\r
-/*\r
- <statement_list> ::= <statement>\r
- | <statement_list> <statement>\r
-*/\r
-statement_list\r
- statement .and .loop statement;\r
-\r
-/*\r
- <expression_statement> ::= ";"\r
- | <expression> ";"\r
-*/\r
-expression_statement\r
- expression_statement_1 .or expression_statement_2;\r
-expression_statement_1\r
- semicolon .emit OP_PUSH_VOID .emit OP_END;\r
-expression_statement_2\r
- expression .and semicolon .emit OP_END;\r
-\r
-/*\r
- <selection_statement> ::= "if" "(" <expression> ")" <selection_rest_statement>\r
-*/\r
-selection_statement\r
- "if" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and\r
- rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;\r
-\r
-/*\r
- <selection_rest_statement> ::= <statement> "else" <statement>\r
- | <statement>\r
-*/\r
-selection_rest_statement\r
- statement .and selection_rest_statement_1;\r
-selection_rest_statement_1\r
- selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\r
-selection_rest_statement_2\r
- "else" .and optional_space .and statement;\r
-\r
-/*\r
- <condition> ::= <expression>\r
- | <fully_specified_type> <identifier> "=" <initializer>\r
-\r
-note: if <condition_1> is executed, the emit format must match <declaration> emit format\r
-*/\r
-condition\r
- condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\r
- condition_3 .emit OP_EXPRESSION;\r
-condition_1\r
- condition_1_nospace .or condition_1_space;\r
-condition_1_nospace\r
- fully_specified_type_nospace .and condition_2;\r
-condition_1_space\r
- fully_specified_type_space .and space .and condition_2;\r
-condition_2\r
- identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and\r
- initializer .and .true .emit DECLARATOR_NONE;\r
-condition_3\r
- expression .and .true .emit OP_END;\r
-\r
-/*\r
- <iteration_statement> ::= "while" "(" <condition> ")" <statement_no_new_scope>\r
- | "do" <statement> "while" "(" <expression> ")" ";"\r
- | "for" "(" <for_init_statement> <for_rest_statement> ")"\r
- <statement_no_new_scope>\r
-*/\r
-iteration_statement\r
- iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\r
-iteration_statement_1\r
- "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\r
- rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\r
-iteration_statement_2\r
- "do" .emit OP_DO .and statement_space .and "while" .and lparen .error LPAREN_EXPECTED .and\r
- expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\r
-iteration_statement_3\r
- "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\r
- for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\r
-\r
-/*\r
- <for_init_statement> ::= <expression_statement>\r
- | <declaration_statement>\r
-*/\r
-for_init_statement\r
- expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;\r
-\r
-/*\r
- <conditionopt> ::= <condition>\r
- | ""\r
-\r
-note: <conditionopt> is used only by "for" statement - if <condition> is ommitted, parser\r
- simulates default behaviour, that is simulates "true" expression\r
-*/\r
-conditionopt\r
- condition .or\r
- .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\0' .emit OP_END;\r
-\r
-/*\r
- <for_rest_statement> ::= <conditionopt> ";"\r
- | <conditionopt> ";" <expression>\r
-*/\r
-for_rest_statement\r
- conditionopt .and semicolon .and for_rest_statement_1;\r
-for_rest_statement_1\r
- for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;\r
-for_rest_statement_2\r
- expression .and .true .emit OP_END;\r
-\r
-/*\r
- <jump_statement> ::= "continue" ";"\r
- | "break" ";"\r
- | "return" ";"\r
- | "return" <expression> ";"\r
- | "discard" ";" // Fragment shader only.\r
-*/\r
-jump_statement\r
- jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or\r
- .if (shader_type == 1) jump_statement_5;\r
-jump_statement_1\r
- "continue" .and semicolon .emit OP_CONTINUE;\r
-jump_statement_2\r
- "break" .and semicolon .emit OP_BREAK;\r
-jump_statement_3\r
- "return" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;\r
-jump_statement_4\r
- "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\r
-jump_statement_5\r
- "discard" .and semicolon .emit OP_DISCARD;\r
-\r
-/*\r
- <__asm_statement> ::= "__asm" <identifier> <asm_arguments> ";"\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- __asm statements\r
-*/\r
-__asm_statement\r
- "__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\r
-\r
-/*\r
- <asm_arguments> ::= <asm_argument>\r
- | <asm_arguments> "," <asm_argument>\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- __asm statements\r
-*/\r
-asm_arguments\r
- asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\r
-asm_arguments_1\r
- comma .and asm_argument .and .true .emit OP_END;\r
-\r
-/*\r
- <asm_argument> ::= <variable_identifier>\r
- | <floatconstant>\r
-\r
-note: this is an extension to the standard language specification - normally slang disallows\r
- __asm statements\r
-*/\r
-asm_argument\r
- variable_identifier .or floatconstant;\r
-\r
-/*\r
- <translation_unit> ::= <external_declaration>\r
- | <translation_unit> <external_declaration>\r
-*/\r
-translation_unit\r
- optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\r
- .loop external_declaration .and optional_space .and\r
- '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\r
-\r
-/*\r
- <external_declaration> ::= <function_definition>\r
- | <declaration>\r
-*/\r
-external_declaration\r
- function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\r
- declaration .emit EXTERNAL_DECLARATION;\r
-\r
-/*\r
- <function_definition> :: <function_prototype> <compound_statement_no_new_scope>\r
-*/\r
-function_definition\r
- function_prototype .and compound_statement_no_new_scope;\r
-\r
-/* helper rulez, not part of the official language syntax */\r
-\r
-digit_oct\r
- '0'-'7';\r
-\r
-digit_dec\r
- '0'-'9';\r
-\r
-digit_hex\r
- '0'-'9' .or 'A'-'F' .or 'a'-'f';\r
-\r
-id_character_first\r
- 'a'-'z' .or 'A'-'Z' .or '_';\r
-\r
-id_character_next\r
- id_character_first .or digit_dec;\r
-\r
-identifier\r
- id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\0';\r
-\r
-float\r
- float_1 .or float_2;\r
-float_1\r
- float_fractional_constant .and float_optional_exponent_part;\r
-float_2\r
- float_digit_sequence .and .true .emit '\0' .and float_exponent_part;\r
-\r
-float_fractional_constant\r
- float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\r
-float_fractional_constant_1\r
- float_digit_sequence .and '.' .and float_digit_sequence;\r
-float_fractional_constant_2\r
- float_digit_sequence .and '.' .and .true .emit '\0';\r
-float_fractional_constant_3\r
- '.' .emit '\0' .and float_digit_sequence;\r
-\r
-float_optional_exponent_part\r
- float_exponent_part .or .true .emit '\0';\r
-\r
-float_digit_sequence\r
- digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0';\r
-\r
-float_exponent_part\r
- float_exponent_part_1 .or float_exponent_part_2;\r
-float_exponent_part_1\r
- 'e' .and float_optional_sign .and float_digit_sequence;\r
-float_exponent_part_2\r
- 'E' .and float_optional_sign .and float_digit_sequence;\r
-\r
-float_optional_sign\r
- float_sign .or .true;\r
-\r
-float_sign\r
- '+' .or '-' .emit '-';\r
-\r
-integer\r
- integer_hex .or integer_oct .or integer_dec;\r
-\r
-integer_hex\r
- '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and\r
- .true .emit '\0';\r
-integer_hex_1\r
- 'x' .or 'X';\r
-\r
-integer_oct\r
- '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\0';\r
-\r
-integer_dec\r
- digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0';\r
-\r
-boolean\r
- "true" .emit 2 .emit '1' .emit '\0' .or\r
- "false" .emit 2 .emit '0' .emit '\0';\r
-\r
-type_name\r
- identifier;\r
-\r
-field_selection\r
- identifier;\r
-\r
-floatconstant\r
- float .emit OP_PUSH_FLOAT;\r
-\r
-intconstant\r
- integer .emit OP_PUSH_INT;\r
-\r
-boolconstant\r
- boolean .emit OP_PUSH_BOOL;\r
-\r
-optional_space\r
- .loop single_space;\r
-\r
-space\r
- single_space .and .loop single_space;\r
-\r
-single_space\r
- white_char .or c_style_comment_block .or cpp_style_comment_block;\r
-\r
-white_char\r
- ' ' .or '\t' .or new_line .or '\v' .or '\f';\r
-\r
-new_line\r
- cr_lf .or lf_cr .or '\n' .or '\r';\r
-\r
-cr_lf\r
- '\r' .and '\n';\r
-\r
-lf_cr\r
- '\n' .and '\r';\r
-\r
-c_style_comment_block\r
- '/' .and '*' .and c_style_comment_rest;\r
-\r
-c_style_comment_rest\r
- .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\r
-c_style_comment_rest_1\r
- c_style_comment_end .or c_style_comment_rest_2;\r
-c_style_comment_rest_2\r
- '*' .and c_style_comment_rest;\r
-\r
-c_style_comment_char_no_star\r
- '\x2B'-'\xFF' .or '\x01'-'\x29';\r
-\r
-c_style_comment_end\r
- '*' .and '/';\r
-\r
-cpp_style_comment_block\r
- '/' .and '/' .and cpp_style_comment_block_1;\r
-cpp_style_comment_block_1\r
- cpp_style_comment_block_2 .or cpp_style_comment_block_3;\r
-cpp_style_comment_block_2\r
- .loop cpp_style_comment_char .and new_line;\r
-cpp_style_comment_block_3\r
- .loop cpp_style_comment_char;\r
-\r
-cpp_style_comment_char\r
- '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';\r
-\r
-/* lexical rulez */\r
-\r
-/*ampersand\r
- optional_space .and '&' .and optional_space;*/\r
-\r
-ampersandampersand\r
- optional_space .and '&' .and '&' .and optional_space;\r
-\r
-/*ampersandequals\r
- optional_space .and '&' .and '=' .and optional_space;*/\r
-\r
-/*bar\r
- optional_space .and '|' .and optional_space;*/\r
-\r
-barbar\r
- optional_space .and '|' .and '|' .and optional_space;\r
-\r
-/*barequals\r
- optional_space .and '|' .and '=' .and optional_space;*/\r
-\r
-bang\r
- optional_space .and '!' .and optional_space;\r
-\r
-bangequals\r
- optional_space .and '!' .and '=' .and optional_space;\r
-\r
-/*caret\r
- optional_space .and '^' .and optional_space;*/\r
-\r
-caretcaret\r
- optional_space .and '^' .and '^' .and optional_space;\r
-\r
-/*caretequals\r
- optional_space .and '^' .and '=' .and optional_space;*/\r
-\r
-colon\r
- optional_space .and ':' .and optional_space;\r
-\r
-comma\r
- optional_space .and ',' .and optional_space;\r
-\r
-dot\r
- optional_space .and '.' .and optional_space;\r
-\r
-equals\r
- optional_space .and '=' .and optional_space;\r
-\r
-equalsequals\r
- optional_space .and '=' .and '=' .and optional_space;\r
-\r
-greater\r
- optional_space .and '>' .and optional_space;\r
-\r
-greaterequals\r
- optional_space .and '>' .and '=' .and optional_space;\r
-\r
-/*greatergreater\r
- optional_space .and '>' .and '>' .and optional_space;*/\r
-\r
-/*greatergreaterequals\r
- optional_space .and '>' .and '>' .and '=' .and optional_space;*/\r
-\r
-lbrace\r
- optional_space .and '{' .and optional_space;\r
-\r
-lbracket\r
- optional_space .and '[' .and optional_space;\r
-\r
-less\r
- optional_space .and '<' .and optional_space;\r
-\r
-lessequals\r
- optional_space .and '<' .and '=' .and optional_space;\r
-\r
-/*lessless\r
- optional_space .and '<' .and '<' .and optional_space;*/\r
-\r
-/*lesslessequals\r
- optional_space .and '<' .and '<' .and '=' .and optional_space;*/\r
-\r
-lparen\r
- optional_space .and '(' .and optional_space;\r
-\r
-minus\r
- optional_space .and '-' .and optional_space;\r
-\r
-minusequals\r
- optional_space .and '-' .and '=' .and optional_space;\r
-\r
-minusminus\r
- optional_space .and '-' .and '-' .and optional_space;\r
-\r
-/*percent\r
- optional_space .and '%' .and optional_space;*/\r
-\r
-/*percentequals\r
- optional_space .and '%' .and '=' .and optional_space;*/\r
-\r
-plus\r
- optional_space .and '+' .and optional_space;\r
-\r
-plusequals\r
- optional_space .and '+' .and '=' .and optional_space;\r
-\r
-plusplus\r
- optional_space .and '+' .and '+' .and optional_space;\r
-\r
-question\r
- optional_space .and '?' .and optional_space;\r
-\r
-rbrace\r
- optional_space .and '}' .and optional_space;\r
-\r
-rbracket\r
- optional_space .and ']' .and optional_space;\r
-\r
-rparen\r
- optional_space .and ')' .and optional_space;\r
-\r
-semicolon\r
- optional_space .and ';' .and optional_space;\r
-\r
-slash\r
- optional_space .and '/' .and optional_space;\r
-\r
-slashequals\r
- optional_space .and '/' .and '=' .and optional_space;\r
-\r
-star\r
- optional_space .and '*' .and optional_space;\r
-\r
-starequals\r
- optional_space .and '*' .and '=' .and optional_space;\r
-\r
-/*tilde\r
- optional_space .and '~' .and optional_space;*/\r
-\r
-/* string rulez - these are used internally by the parser when parsing quoted strings */\r
-\r
-.string string_lexer;\r
-\r
-string_lexer\r
- lex_first_identifier_character .and .loop lex_next_identifier_character;\r
-\r
-lex_first_identifier_character\r
- 'a'-'z' .or 'A'-'Z' .or '_';\r
-\r
-lex_next_identifier_character\r
- 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\r
-\r
-/* error rulez - these are used by error messages */\r
-\r
-err_token\r
- '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or\r
- '-' .or '+' .or '=' .or '|' .or '\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '"' .or\r
- '\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\r
-\r
-err_identifier\r
- id_character_first .and .loop id_character_next;\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2004-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_shader.syn
+ * slang vertex/fragment shader syntax
+ * \author Michal Krol
+ */
+
+/*
+ * usage:
+ * syn2c slang_shader.syn > slang_shader_syn.h
+ *
+ * when modifying or extending this file, several things must be taken into consideration:
+ * - when adding new operators that were marked as reserved in the initial specification,
+ * one must only uncomment particular lines of code that refer to operators being added;
+ * - when adding new shader target, one must reserve new value for shader_type register and
+ * use it in .if constructs for symbols that are exclusive for that shader;
+ * - some symbols mimic output of other symbols - the best example is the "for" construct:
+ * expression "for (foo(); ; bar())" is seen as "for (foo(); true; bar())" by the output
+ * processor - hence, special care must be taken when rearranging output of essential symbols;
+ * - order of single-quoted tokens does matter in alternatives - so do not parse "<" operator
+ * before "<<" and "<<" before "<<=";
+ * - all double-quoted tokens are internally preprocessed to eliminate problems with parsing
+ * strings that are prefixes of other strings, like "sampler1D" and "sampler1DShadow";
+ */
+
+.syntax translation_unit;
+
+/* revision number - increment after each change affecting emitted output */
+.emtcode REVISION 3
+
+/* external declaration */
+.emtcode EXTERNAL_NULL 0
+.emtcode EXTERNAL_FUNCTION_DEFINITION 1
+.emtcode EXTERNAL_DECLARATION 2
+
+/* declaration */
+.emtcode DECLARATION_FUNCTION_PROTOTYPE 1
+.emtcode DECLARATION_INIT_DECLARATOR_LIST 2
+
+/* function type */
+.emtcode FUNCTION_ORDINARY 0
+.emtcode FUNCTION_CONSTRUCTOR 1
+.emtcode FUNCTION_OPERATOR 2
+
+/* operator type */
+.emtcode OPERATOR_ADDASSIGN 1
+.emtcode OPERATOR_SUBASSIGN 2
+.emtcode OPERATOR_MULASSIGN 3
+.emtcode OPERATOR_DIVASSIGN 4
+/*.emtcode OPERATOR_MODASSIGN 5*/
+/*.emtcode OPERATOR_LSHASSIGN 6*/
+/*.emtcode OPERATOR_RSHASSIGN 7*/
+/*.emtcode OPERATOR_ORASSIGN 8*/
+/*.emtcode OPERATOR_XORASSIGN 9*/
+/*.emtcode OPERATOR_ANDASSIGN 10*/
+.emtcode OPERATOR_LOGICALXOR 11
+/*.emtcode OPERATOR_BITOR 12*/
+/*.emtcode OPERATOR_BITXOR 13*/
+/*.emtcode OPERATOR_BITAND 14*/
+.emtcode OPERATOR_LESS 15
+.emtcode OPERATOR_GREATER 16
+.emtcode OPERATOR_LESSEQUAL 17
+.emtcode OPERATOR_GREATEREQUAL 18
+/*.emtcode OPERATOR_LSHIFT 19*/
+/*.emtcode OPERATOR_RSHIFT 20*/
+.emtcode OPERATOR_MULTIPLY 21
+.emtcode OPERATOR_DIVIDE 22
+/*.emtcode OPERATOR_MODULUS 23*/
+.emtcode OPERATOR_INCREMENT 24
+.emtcode OPERATOR_DECREMENT 25
+.emtcode OPERATOR_PLUS 26
+.emtcode OPERATOR_MINUS 27
+/*.emtcode OPERATOR_COMPLEMENT 28*/
+.emtcode OPERATOR_NOT 29
+
+/* init declarator list */
+.emtcode DECLARATOR_NONE 0
+.emtcode DECLARATOR_NEXT 1
+
+/* variable declaration */
+.emtcode VARIABLE_NONE 0
+.emtcode VARIABLE_IDENTIFIER 1
+.emtcode VARIABLE_INITIALIZER 2
+.emtcode VARIABLE_ARRAY_EXPLICIT 3
+.emtcode VARIABLE_ARRAY_UNKNOWN 4
+
+/* type qualifier */
+.emtcode TYPE_QUALIFIER_NONE 0
+.emtcode TYPE_QUALIFIER_CONST 1
+.emtcode TYPE_QUALIFIER_ATTRIBUTE 2
+.emtcode TYPE_QUALIFIER_VARYING 3
+.emtcode TYPE_QUALIFIER_UNIFORM 4
+.emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5
+.emtcode TYPE_QUALIFIER_FIXEDINPUT 6
+
+/* type specifier */
+.emtcode TYPE_SPECIFIER_VOID 0
+.emtcode TYPE_SPECIFIER_BOOL 1
+.emtcode TYPE_SPECIFIER_BVEC2 2
+.emtcode TYPE_SPECIFIER_BVEC3 3
+.emtcode TYPE_SPECIFIER_BVEC4 4
+.emtcode TYPE_SPECIFIER_INT 5
+.emtcode TYPE_SPECIFIER_IVEC2 6
+.emtcode TYPE_SPECIFIER_IVEC3 7
+.emtcode TYPE_SPECIFIER_IVEC4 8
+.emtcode TYPE_SPECIFIER_FLOAT 9
+.emtcode TYPE_SPECIFIER_VEC2 10
+.emtcode TYPE_SPECIFIER_VEC3 11
+.emtcode TYPE_SPECIFIER_VEC4 12
+.emtcode TYPE_SPECIFIER_MAT2 13
+.emtcode TYPE_SPECIFIER_MAT3 14
+.emtcode TYPE_SPECIFIER_MAT4 15
+.emtcode TYPE_SPECIFIER_SAMPLER1D 16
+.emtcode TYPE_SPECIFIER_SAMPLER2D 17
+.emtcode TYPE_SPECIFIER_SAMPLER3D 18
+.emtcode TYPE_SPECIFIER_SAMPLERCUBE 19
+.emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20
+.emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21
+.emtcode TYPE_SPECIFIER_STRUCT 22
+.emtcode TYPE_SPECIFIER_TYPENAME 23
+
+/* structure field */
+.emtcode FIELD_NONE 0
+.emtcode FIELD_NEXT 1
+.emtcode FIELD_ARRAY 2
+
+/* operation */
+.emtcode OP_END 0
+.emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1
+.emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2
+.emtcode OP_DECLARE 3
+.emtcode OP_ASM 4
+.emtcode OP_BREAK 5
+.emtcode OP_CONTINUE 6
+.emtcode OP_DISCARD 7
+.emtcode OP_RETURN 8
+.emtcode OP_EXPRESSION 9
+.emtcode OP_IF 10
+.emtcode OP_WHILE 11
+.emtcode OP_DO 12
+.emtcode OP_FOR 13
+.emtcode OP_PUSH_VOID 14
+.emtcode OP_PUSH_BOOL 15
+.emtcode OP_PUSH_INT 16
+.emtcode OP_PUSH_FLOAT 17
+.emtcode OP_PUSH_IDENTIFIER 18
+.emtcode OP_SEQUENCE 19
+.emtcode OP_ASSIGN 20
+.emtcode OP_ADDASSIGN 21
+.emtcode OP_SUBASSIGN 22
+.emtcode OP_MULASSIGN 23
+.emtcode OP_DIVASSIGN 24
+/*.emtcode OP_MODASSIGN 25*/
+/*.emtcode OP_LSHASSIGN 26*/
+/*.emtcode OP_RSHASSIGN 27*/
+/*.emtcode OP_ORASSIGN 28*/
+/*.emtcode OP_XORASSIGN 29*/
+/*.emtcode OP_ANDASSIGN 30*/
+.emtcode OP_SELECT 31
+.emtcode OP_LOGICALOR 32
+.emtcode OP_LOGICALXOR 33
+.emtcode OP_LOGICALAND 34
+/*.emtcode OP_BITOR 35*/
+/*.emtcode OP_BITXOR 36*/
+/*.emtcode OP_BITAND 37*/
+.emtcode OP_EQUAL 38
+.emtcode OP_NOTEQUAL 39
+.emtcode OP_LESS 40
+.emtcode OP_GREATER 41
+.emtcode OP_LESSEQUAL 42
+.emtcode OP_GREATEREQUAL 43
+/*.emtcode OP_LSHIFT 44*/
+/*.emtcode OP_RSHIFT 45*/
+.emtcode OP_ADD 46
+.emtcode OP_SUBTRACT 47
+.emtcode OP_MULTIPLY 48
+.emtcode OP_DIVIDE 49
+/*.emtcode OP_MODULUS 50*/
+.emtcode OP_PREINCREMENT 51
+.emtcode OP_PREDECREMENT 52
+.emtcode OP_PLUS 53
+.emtcode OP_MINUS 54
+/*.emtcode OP_COMPLEMENT 55*/
+.emtcode OP_NOT 56
+.emtcode OP_SUBSCRIPT 57
+.emtcode OP_CALL 58
+.emtcode OP_FIELD 59
+.emtcode OP_POSTINCREMENT 60
+.emtcode OP_POSTDECREMENT 61
+
+/* parameter qualifier */
+.emtcode PARAM_QUALIFIER_IN 0
+.emtcode PARAM_QUALIFIER_OUT 1
+.emtcode PARAM_QUALIFIER_INOUT 2
+
+/* function parameter */
+.emtcode PARAMETER_NONE 0
+.emtcode PARAMETER_NEXT 1
+
+/* function parameter array presence */
+.emtcode PARAMETER_ARRAY_NOT_PRESENT 0
+.emtcode PARAMETER_ARRAY_PRESENT 1
+
+.errtext INVALID_EXTERNAL_DECLARATION "error 2001: invalid external declaration"
+.errtext INVALID_OPERATOR_OVERRIDE "error 2002: invalid operator override"
+.errtext LBRACE_EXPECTED "error 2003: '{' expected but '$err_token$' found"
+.errtext LPAREN_EXPECTED "error 2004: '(' expected but '$err_token$' found"
+.errtext RPAREN_EXPECTED "error 2005: ')' expected but '$err_token$' found"
+
+/* tells whether the shader that is being parsed is a built-in shader or not */
+/* 0 - normal behaviour */
+/* 1 - accepts constructor and operator definitions and __asm statements */
+/* the implementation will set it to 1 when compiling internal built-in shaders */
+.regbyte parsing_builtin 0
+
+/* holds the type of the shader being parsed; possible values are listed below */
+/* FRAGMENT_SHADER 1 */
+/* VERTEX_SHADER 2 */
+/* shader type is set by the caller before parsing */
+.regbyte shader_type 0
+
+/*
+ <variable_identifier> ::= <identifier>
+*/
+variable_identifier
+ identifier .emit OP_PUSH_IDENTIFIER;
+
+/*
+ <primary_expression> ::= <variable_identifier>
+ | <intconstant>
+ | <floatconstant>
+ | <boolconstant>
+ | "(" <expression> ")"
+*/
+primary_expression
+ floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;
+primary_expression_1
+ lparen .and expression .and rparen;
+
+/*
+ <postfix_expression> ::= <primary_expression>
+ | <postfix_expression> "[" <integer_expression> "]"
+ | <function_call>
+ | <postfix_expression> "." <field_selection>
+ | <postfix_expression> "++"
+ | <postfix_expression> "--"
+*/
+postfix_expression
+ postfix_expression_1 .and .loop postfix_expression_2;
+postfix_expression_1
+ function_call .or primary_expression;
+postfix_expression_2
+ postfix_expression_3 .or postfix_expression_4 .or
+ plusplus .emit OP_POSTINCREMENT .or
+ minusminus .emit OP_POSTDECREMENT;
+postfix_expression_3
+ lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;
+postfix_expression_4
+ dot .and field_selection .emit OP_FIELD;
+
+/*
+ <integer_expression> ::= <expression>
+*/
+integer_expression
+ expression;
+
+/*
+ <function_call> ::= <function_call_generic>
+*/
+function_call
+ function_call_generic .emit OP_CALL .and .true .emit OP_END;
+
+/*
+ <function_call_generic> ::= <function_call_header_with_parameters> ")"
+ | <function_call_header_no_parameters> ")"
+*/
+function_call_generic
+ function_call_generic_1 .or function_call_generic_2;
+function_call_generic_1
+ function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;
+function_call_generic_2
+ function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;
+
+/*
+ <function_call_header_no_parameters>::= <function_call_header> "void"
+ | <function_call_header>
+*/
+function_call_header_no_parameters
+ function_call_header .and function_call_header_no_parameters_1;
+function_call_header_no_parameters_1
+ "void" .or .true;
+
+/*
+ <function_call_header_with_parameters>::= <function_call_header> <assignment_expression>
+ | <function_call_header_with_parameters> ","
+ <assignment_expression>
+*/
+function_call_header_with_parameters
+ function_call_header .and assignment_expression .and .true .emit OP_END .and
+ .loop function_call_header_with_parameters_1;
+function_call_header_with_parameters_1
+ comma .and assignment_expression .and .true .emit OP_END;
+
+/*
+ <function_call_header> ::= <function_identifier> "("
+*/
+function_call_header
+ function_identifier .and lparen;
+
+/*
+ <function_identifier> ::= <constructor_identifier>
+ | <identifier>
+
+note: <constructor_identifier> has been deleted
+*/
+function_identifier
+ identifier;
+
+/*
+ <unary_expression> ::= <postfix_expression>
+ | "++" <unary_expression>
+ | "--" <unary_expression>
+ | <unary_operator> <unary_expression>
+
+ <unary_operator> ::= "+"
+ | "-"
+ | "!"
+ | "~" // reserved
+*/
+unary_expression
+ postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or
+ unary_expression_4 .or unary_expression_5/* .or unary_expression_6*/;
+unary_expression_1
+ plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;
+unary_expression_2
+ minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;
+unary_expression_3
+ plus .and unary_expression .and .true .emit OP_PLUS;
+unary_expression_4
+ minus .and unary_expression .and .true .emit OP_MINUS;
+unary_expression_5
+ bang .and unary_expression .and .true .emit OP_NOT;
+/*unary_expression_6
+ tilde .and unary_expression .and .true .emit OP_COMPLEMENT;*/
+
+/*
+ <multiplicative_expression> ::= <unary_expression>
+ | <multiplicative_expression> "*" <unary_expression>
+ | <multiplicative_expression> "/" <unary_expression>
+ | <multiplicative_expression> "%" <unary_expression> // reserved
+*/
+multiplicative_expression
+ unary_expression .and .loop multiplicative_expression_1;
+multiplicative_expression_1
+ multiplicative_expression_2 .or multiplicative_expression_3/* .or multiplicative_expression_4*/;
+multiplicative_expression_2
+ star .and unary_expression .and .true .emit OP_MULTIPLY;
+multiplicative_expression_3
+ slash .and unary_expression .and .true .emit OP_DIVIDE;
+/*multiplicative_expression_4
+ percent .and unary_expression .and .true .emit OP_MODULUS;*/
+
+/*
+ <additive_expression> ::= <multiplicative_expression>
+ | <additive_expression> "+" <multiplicative_expression>
+ | <additive_expression> "-" <multiplicative_expression>
+*/
+additive_expression
+ multiplicative_expression .and .loop additive_expression_1;
+additive_expression_1
+ additive_expression_2 .or additive_expression_3;
+additive_expression_2
+ plus .and multiplicative_expression .and .true .emit OP_ADD;
+additive_expression_3
+ minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;
+
+/*
+ <shift_expression> ::= <additive_expression>
+ | <shift_expression> "<<" <additive_expression> // reserved
+ | <shift_expression> ">>" <additive_expression> // reserved
+*/
+shift_expression
+ additive_expression/* .and .loop shift_expression_1*/;
+/*shift_expression_1
+ shift_expression_2 .or shift_expression_3;*/
+/*shift_expression_2
+ lessless .and additive_expression .and .true .emit OP_LSHIFT;*/
+/*shift_expression_3
+ greatergreater .and additive_expression .and .true .emit OP_RSHIFT;*/
+
+/*
+ <relational_expression> ::= <shift_expression>
+ | <relational_expression> "<" <shift_expression>
+ | <relational_expression> ">" <shift_expression>
+ | <relational_expression> "<=" <shift_expression>
+ | <relational_expression> ">=" <shift_expression>
+*/
+relational_expression
+ shift_expression .and .loop relational_expression_1;
+relational_expression_1
+ relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or
+ relational_expression_5;
+relational_expression_2
+ lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;
+relational_expression_3
+ greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;
+relational_expression_4
+ less .and shift_expression .and .true .emit OP_LESS;
+relational_expression_5
+ greater .and shift_expression .and .true .emit OP_GREATER;
+
+/*
+ <equality_expression> ::= <relational_expression>
+ | <equality_expression> "==" <relational_expression>
+ | <equality_expression> "!=" <relational_expression>
+*/
+equality_expression
+ relational_expression .and .loop equality_expression_1;
+equality_expression_1
+ equality_expression_2 .or equality_expression_3;
+equality_expression_2
+ equalsequals .and relational_expression .and .true .emit OP_EQUAL;
+equality_expression_3
+ bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;
+
+/*
+ <and_expression> ::= <equality_expression>
+ | <and_expression> "&" <equality_expression> // reserved
+*/
+and_expression
+ equality_expression/* .and .loop and_expression_1*/;
+/*and_expression_1
+ ampersand .and equality_expression .and .true .emit OP_BITAND;*/
+
+/*
+ <exclusive_or_expression> ::= <and_expression>
+ | <exclusive_or_expression> "^" <and_expression> // reserved
+*/
+exclusive_or_expression
+ and_expression/* .and .loop exclusive_or_expression_1*/;
+/*exclusive_or_expression_1
+ caret .and and_expression .and .true .emit OP_BITXOR;*/
+
+/*
+ <inclusive_or_expression> ::= <exclusive_or_expression>
+ | <inclusive_or_expression> "|" <exclusive_or_expression> // reserved
+*/
+inclusive_or_expression
+ exclusive_or_expression/* .and .loop inclusive_or_expression_1*/;
+/*inclusive_or_expression_1
+ bar .and exclusive_or_expression .and .true .emit OP_BITOR;*/
+
+/*
+ <logical_and_expression> ::= <inclusive_or_expression>
+ | <logical_and_expression> "&&" <inclusive_or_expression>
+*/
+logical_and_expression
+ inclusive_or_expression .and .loop logical_and_expression_1;
+logical_and_expression_1
+ ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;
+
+/*
+ <logical_xor_expression> ::= <logical_and_expression>
+ | <logical_xor_expression> "^^" <logical_and_expression>
+*/
+logical_xor_expression
+ logical_and_expression .and .loop logical_xor_expression_1;
+logical_xor_expression_1
+ caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;
+
+/*
+ <logical_or_expression> ::= <logical_xor_expression>
+ | <logical_or_expression> "||" <logical_xor_expression>
+*/
+logical_or_expression
+ logical_xor_expression .and .loop logical_or_expression_1;
+logical_or_expression_1
+ barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;
+
+/*
+ <conditional_expression> ::= <logical_or_expression>
+ | <logical_or_expression> "?" <expression> ":"
+ <conditional_expression>
+*/
+conditional_expression
+ logical_or_expression .and .loop conditional_expression_1;
+conditional_expression_1
+ question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;
+
+/*
+ <assignment_expression> ::= <conditional_expression>
+ | <unary_expression> <assignment_operator>
+ <assignment_expression>
+
+ <assignment_operator> ::= "="
+ | "*="
+ | "/="
+ | "+="
+ | "-="
+ | "%=" // reserved
+ | "<<=" // reserved
+ | ">>=" // reserved
+ | "&=" // reserved
+ | "^=" // reserved
+ | "|=" // reserved
+*/
+assignment_expression
+ assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or
+ assignment_expression_4 .or assignment_expression_5/* .or assignment_expression_6 .or
+ assignment_expression_7 .or assignment_expression_8 .or assignment_expression_9 .or
+ assignment_expression_10 .or assignment_expression_11*/ .or conditional_expression;
+assignment_expression_1
+ unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;
+assignment_expression_2
+ unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;
+assignment_expression_3
+ unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;
+assignment_expression_4
+ unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;
+assignment_expression_5
+ unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;
+/*assignment_expression_6
+ unary_expression .and percentequals .and assignment_expression .and .true .emit OP_MODASSIGN;*/
+/*assignment_expression_7
+ unary_expression .and lesslessequals .and assignment_expression .and .true .emit OP_LSHASSIGN;*/
+/*assignment_expression_8
+ unary_expression .and greatergreaterequals .and assignment_expression .and
+ .true .emit OP_RSHASSIGN;*/
+/*assignment_expression_9
+ unary_expression .and ampersandequals .and assignment_expression .and .true .emit OP_ANDASSIGN;*/
+/*assignment_expression_10
+ unary_expression .and caretequals .and assignment_expression .and .true .emit OP_XORASSIGN;*/
+/*assignment_expression_11
+ unary_expression .and barequals .and assignment_expression .and .true .emit OP_ORASSIGN;*/
+
+/*
+ <expression> ::= <assignment_expression>
+ | <expression> "," <assignment_expression>
+*/
+expression
+ assignment_expression .and .loop expression_1;
+expression_1
+ comma .and assignment_expression .and .true .emit OP_SEQUENCE;
+
+/*
+ <constant_expression> ::= <conditional_expression>
+*/
+constant_expression
+ conditional_expression .and .true .emit OP_END;
+
+/*
+ <declaration> ::= <function_prototype> ";"
+ | <init_declarator_list> ";"
+*/
+declaration
+ declaration_1 .or declaration_2;
+declaration_1
+ function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;
+declaration_2
+ init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;
+
+/*
+ <function_prototype> ::= <function_header> "void" ")"
+ | <function_declarator> ")"
+*/
+function_prototype
+ function_prototype_1 .or function_prototype_2;
+function_prototype_1
+ function_header .and "void" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;
+function_prototype_2
+ function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;
+
+/*
+ <function_declarator> ::= <function_header>
+ | <function_header_with_parameters>
+*/
+function_declarator
+ function_header_with_parameters .or function_header;
+
+/*
+ <function_header_with_parameters> ::= <function_header> <parameter_declaration>
+ | <function_header_with_parameters> ","
+ <parameter_declaration>
+*/
+function_header_with_parameters
+ function_header .and parameter_declaration .and .loop function_header_with_parameters_1;
+function_header_with_parameters_1
+ comma .and parameter_declaration;
+
+/*
+ <function_header> ::= <fully_specified_type> <identifier> "("
+*/
+function_header
+ function_header_nospace .or function_header_space;
+function_header_space
+ fully_specified_type_space .and space .and function_decl_identifier .and lparen;
+function_header_nospace
+ fully_specified_type_nospace .and function_decl_identifier .and lparen;
+
+/*
+ <function_decl_identifier> ::= "__constructor"
+ | <__operator>
+ | <identifier>
+
+note: this is an extension to the standard language specification - normally slang disallows
+ operator and constructor prototypes and definitions
+*/
+function_decl_identifier
+ .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or
+ .if (parsing_builtin != 0) "__constructor" .emit FUNCTION_CONSTRUCTOR .or
+ identifier .emit FUNCTION_ORDINARY;
+
+/*
+ <__operator> ::= "__operator" <overriden_op>
+
+note: this is an extension to the standard language specification - normally slang disallows
+ operator prototypes and definitions
+*/
+__operator
+ "__operator" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;
+
+/*
+ <overriden_op> ::= "="
+ | "+="
+ | "-="
+ | "*="
+ | "/="
+ | "%=" // reserved
+ | "<<=" // reserved
+ | ">>=" // reserved
+ | "&=" // reserved
+ | "^=" // reserved
+ | "|=" // reserved
+ | "^^"
+ | "|" // reserved
+ | "^" // reserved
+ | "&" // reserved
+ | "=="
+ | "!="
+ | "<"
+ | ">"
+ | "<="
+ | ">="
+ | "<<" // reserved
+ | ">>" // reserved
+ | "*"
+ | "/"
+ | "%" // reserved
+ | "++"
+ | "--"
+ | "+"
+ | "-"
+ | "~" // reserved
+ | "!"
+
+note: this is an extension to the standard language specification - normally slang disallows
+ operator prototypes and definitions
+*/
+overriden_operator
+ plusplus .emit OPERATOR_INCREMENT .or
+ plusequals .emit OPERATOR_ADDASSIGN .or
+ plus .emit OPERATOR_PLUS .or
+ minusminus .emit OPERATOR_DECREMENT .or
+ minusequals .emit OPERATOR_SUBASSIGN .or
+ minus .emit OPERATOR_MINUS .or
+ bang .emit OPERATOR_NOT .or
+ starequals .emit OPERATOR_MULASSIGN .or
+ star .emit OPERATOR_MULTIPLY .or
+ slashequals .emit OPERATOR_DIVASSIGN .or
+ slash .emit OPERATOR_DIVIDE .or
+ lessequals .emit OPERATOR_LESSEQUAL .or
+ /*lesslessequals .emit OPERATOR_LSHASSIGN .or*/
+ /*lessless .emit OPERATOR_LSHIFT .or*/
+ less .emit OPERATOR_LESS .or
+ greaterequals .emit OPERATOR_GREATEREQUAL .or
+ /*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/
+ /*greatergreater .emit OPERATOR_RSHIFT .or*/
+ greater .emit OPERATOR_GREATER .or
+ /*percentequals .emit OPERATOR_MODASSIGN .or*/
+ /*percent .emit OPERATOR_MODULUS .or*/
+ /*ampersandequals .emit OPERATOR_ANDASSIGN */
+ /*ampersand .emit OPERATOR_BITAND .or*/
+ /*barequals .emit OPERATOR_ORASSIGN .or*/
+ /*bar .emit OPERATOR_BITOR .or*/
+ /*tilde .emit OPERATOR_COMPLEMENT .or*/
+ /*caretequals .emit OPERATOR_XORASSIGN .or*/
+ caretcaret .emit OPERATOR_LOGICALXOR /*.or
+ caret .emit OPERATOR_BITXOR*/;
+
+/*
+ <parameter_declarator> ::= <type_specifier> <identifier>
+ | <type_specifier> <identifier> "[" <constant_expression>
+ "]"
+*/
+parameter_declarator
+ parameter_declarator_nospace .or parameter_declarator_space;
+parameter_declarator_nospace
+ type_specifier_nospace .and identifier .and parameter_declarator_1;
+parameter_declarator_space
+ type_specifier_space .and space .and identifier .and parameter_declarator_1;
+parameter_declarator_1
+ parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or
+ .true .emit PARAMETER_ARRAY_NOT_PRESENT;
+parameter_declarator_2
+ lbracket .and constant_expression .and rbracket;
+
+/*
+ <parameter_declaration> ::= <type_qualifier> <parameter_qualifier>
+ <parameter_declarator>
+ | <type_qualifier> <parameter_qualifier>
+ <parameter_type_specifier>
+ | <parameter_qualifier> <parameter_declarator>
+ | <parameter_qualifier> <parameter_type_specifier>
+*/
+parameter_declaration
+ parameter_declaration_1 .emit PARAMETER_NEXT;
+parameter_declaration_1
+ parameter_declaration_2 .or parameter_declaration_3;
+parameter_declaration_2
+ type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;
+parameter_declaration_3
+ parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;
+parameter_declaration_4
+ parameter_declarator .or parameter_type_specifier;
+
+/*
+ <parameter_qualifier> ::= "in"
+ | "out"
+ | "inout"
+ | ""
+*/
+parameter_qualifier
+ parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;
+parameter_qualifier_1
+ parameter_qualifier_2 .and space;
+parameter_qualifier_2
+ "in" .emit PARAM_QUALIFIER_IN .or
+ "out" .emit PARAM_QUALIFIER_OUT .or
+ "inout" .emit PARAM_QUALIFIER_INOUT;
+
+/*
+ <parameter_type_specifier> ::= <type_specifier>
+ | <type_specifier> "[" <constant_expression> "]"
+*/
+parameter_type_specifier
+ parameter_type_specifier_1 .and .true .emit '\0' .and parameter_type_specifier_2;
+parameter_type_specifier_1
+ type_specifier_nospace .or type_specifier_space;
+parameter_type_specifier_2
+ parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or
+ .true .emit PARAMETER_ARRAY_NOT_PRESENT;
+parameter_type_specifier_3
+ lbracket .and constant_expression .and rbracket;
+
+/*
+ <init_declarator_list> ::= <single_declaration>
+ | <init_declarator_list> "," <identifier>
+ | <init_declarator_list> "," <identifier> "[" "]"
+ | <init_declarator_list> "," <identifier> "["
+ <constant_expression> "]"
+ | <init_declarator_list> "," <identifier> "="
+ <initializer>
+*/
+init_declarator_list
+ single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and
+ .true .emit DECLARATOR_NONE;
+init_declarator_list_1
+ comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;
+init_declarator_list_2
+ init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;
+init_declarator_list_3
+ equals .and initializer .emit VARIABLE_INITIALIZER;
+init_declarator_list_4
+ lbracket .and init_declarator_list_5 .and rbracket;
+init_declarator_list_5
+ constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;
+
+/*
+ <single_declaration> ::= <fully_specified_type>
+ | <fully_specified_type> <identifier>
+ | <fully_specified_type> <identifier> "[" "]"
+ | <fully_specified_type> <identifier> "["
+ <constant_expression> "]"
+ | <fully_specified_type> <identifier> "=" <initializer>
+*/
+single_declaration
+ single_declaration_nospace .or single_declaration_space;
+single_declaration_space
+ fully_specified_type_space .and single_declaration_space_1;
+single_declaration_nospace
+ fully_specified_type_nospace .and single_declaration_nospace_1;
+single_declaration_space_1
+ single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;
+single_declaration_nospace_1
+ single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;
+single_declaration_space_2
+ space .and identifier .and single_declaration_3;
+single_declaration_nospace_2
+ identifier .and single_declaration_3;
+single_declaration_3
+ single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;
+single_declaration_4
+ equals .and initializer .emit VARIABLE_INITIALIZER;
+single_declaration_5
+ lbracket .and single_declaration_6 .and rbracket;
+single_declaration_6
+ constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;
+
+/*
+ <fully_specified_type> ::= <type_specifier>
+ | <type_qualifier> <type_specifier>
+*/
+fully_specified_type_space
+ fully_specified_type_1 .and type_specifier_space;
+fully_specified_type_nospace
+ fully_specified_type_1 .and type_specifier_nospace;
+fully_specified_type_1
+ fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;
+fully_specified_type_2
+ type_qualifier .and space;
+
+/*
+ <type_qualifier> ::= "const"
+ | "attribute" // Vertex only.
+ | "varying"
+ | "uniform"
+ | "__fixed_output"
+ | "__fixed_input"
+
+note: this is an extension to the standard language specification - normally slang disallows
+ __fixed_output and __fixed_input type qualifiers
+*/
+type_qualifier
+ "const" .emit TYPE_QUALIFIER_CONST .or
+ .if (shader_type == 2) "attribute" .emit TYPE_QUALIFIER_ATTRIBUTE .or
+ "varying" .emit TYPE_QUALIFIER_VARYING .or
+ "uniform" .emit TYPE_QUALIFIER_UNIFORM .or
+ .if (parsing_builtin != 0) "__fixed_output" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or
+ .if (parsing_builtin != 0) "__fixed_input" .emit TYPE_QUALIFIER_FIXEDINPUT;
+
+/*
+ <type_specifier> ::= "void"
+ | "float"
+ | "int"
+ | "bool"
+ | "vec2"
+ | "vec3"
+ | "vec4"
+ | "bvec2"
+ | "bvec3"
+ | "bvec4"
+ | "ivec2"
+ | "ivec3"
+ | "ivec4"
+ | "mat2"
+ | "mat3"
+ | "mat4"
+ | "sampler1D"
+ | "sampler2D"
+ | "sampler3D"
+ | "samplerCube"
+ | "sampler1DShadow"
+ | "sampler2DShadow"
+ | <struct_specifier>
+ | <type_name>
+*/
+type_specifier_space
+ "void" .emit TYPE_SPECIFIER_VOID .or
+ "float" .emit TYPE_SPECIFIER_FLOAT .or
+ "int" .emit TYPE_SPECIFIER_INT .or
+ "bool" .emit TYPE_SPECIFIER_BOOL .or
+ "vec2" .emit TYPE_SPECIFIER_VEC2 .or
+ "vec3" .emit TYPE_SPECIFIER_VEC3 .or
+ "vec4" .emit TYPE_SPECIFIER_VEC4 .or
+ "bvec2" .emit TYPE_SPECIFIER_BVEC2 .or
+ "bvec3" .emit TYPE_SPECIFIER_BVEC3 .or
+ "bvec4" .emit TYPE_SPECIFIER_BVEC4 .or
+ "ivec2" .emit TYPE_SPECIFIER_IVEC2 .or
+ "ivec3" .emit TYPE_SPECIFIER_IVEC3 .or
+ "ivec4" .emit TYPE_SPECIFIER_IVEC4 .or
+ "mat2" .emit TYPE_SPECIFIER_MAT2 .or
+ "mat3" .emit TYPE_SPECIFIER_MAT3 .or
+ "mat4" .emit TYPE_SPECIFIER_MAT4 .or
+ "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or
+ "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or
+ "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or
+ "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or
+ "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or
+ "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or
+ type_name .emit TYPE_SPECIFIER_TYPENAME;
+type_specifier_nospace
+ struct_specifier .emit TYPE_SPECIFIER_STRUCT;
+
+/*
+ <struct_specifier> ::= "struct" <identifier> "{" <struct_declaration_list> "}"
+ | "struct" "{" <struct_declaration_list> "}"
+*/
+struct_specifier
+ "struct" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and
+ struct_declaration_list .and rbrace .emit FIELD_NONE;
+struct_specifier_1
+ struct_specifier_2 .or .true .emit '\0';
+struct_specifier_2
+ space .and identifier;
+
+/*
+ <struct_declaration_list> ::= <struct_declaration>
+ | <struct_declaration_list> <struct_declaration>
+*/
+struct_declaration_list
+ struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;
+
+/*
+ <struct_declaration> ::= <type_specifier> <struct_declarator_list> ";"
+*/
+struct_declaration
+ struct_declaration_nospace .or struct_declaration_space;
+struct_declaration_space
+ type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;
+struct_declaration_nospace
+ type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;
+
+/*
+ <struct_declarator_list> ::= <struct_declarator>
+ | <struct_declarator_list> "," <struct_declarator>
+*/
+struct_declarator_list
+ struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;
+struct_declarator_list_1
+ comma .and struct_declarator;
+
+/*
+ <struct_declarator> ::= <identifier>
+ | <identifier> "[" <constant_expression> "]"
+*/
+struct_declarator
+ identifier .and struct_declarator_1;
+struct_declarator_1
+ struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;
+struct_declarator_2
+ lbracket .and constant_expression .and rbracket;
+
+/*
+ <initializer> ::= <assignment_expression>
+*/
+initializer
+ assignment_expression .and .true .emit OP_END;
+
+/*
+ <declaration_statement> ::= <declaration>
+*/
+declaration_statement
+ declaration;
+
+/*
+ <statement> ::= <compound_statement>
+ | <simple_statement>
+*/
+statement
+ compound_statement .or simple_statement;
+statement_space
+ compound_statement .or statement_space_1;
+statement_space_1
+ space .and simple_statement;
+
+/*
+ <simple_statement> ::= <__asm_statement>
+ | <selection_statement>
+ | <iteration_statement>
+ | <jump_statement>
+ | <expression_statement>
+ | <declaration_statement>
+
+note: this is an extension to the standard language specification - normally slang disallows
+ use of __asm statements
+*/
+simple_statement
+ .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or
+ selection_statement .or
+ iteration_statement .or
+ jump_statement .or
+ expression_statement .emit OP_EXPRESSION .or
+ declaration_statement .emit OP_DECLARE;
+
+/*
+ <compound_statement> ::= "{" "}"
+ | "{" <statement_list> "}"
+*/
+compound_statement
+ compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;
+compound_statement_1
+ compound_statement_2 .or compound_statement_3;
+compound_statement_2
+ lbrace .and rbrace;
+compound_statement_3
+ lbrace .and statement_list .and rbrace;
+
+/*
+ <statement_no_new_scope> ::= <compound_statement_no_new_scope>
+ | <simple_statement>
+*/
+statement_no_new_scope
+ compound_statement_no_new_scope .or simple_statement;
+
+/*
+ <compound_statement_no_new_scope> ::= "{" "}"
+ | "{" <statement_list> "}"
+*/
+compound_statement_no_new_scope
+ compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;
+compound_statement_no_new_scope_1
+ compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;
+compound_statement_no_new_scope_2
+ lbrace .and rbrace;
+compound_statement_no_new_scope_3
+ lbrace .and statement_list .and rbrace;
+
+/*
+ <statement_list> ::= <statement>
+ | <statement_list> <statement>
+*/
+statement_list
+ statement .and .loop statement;
+
+/*
+ <expression_statement> ::= ";"
+ | <expression> ";"
+*/
+expression_statement
+ expression_statement_1 .or expression_statement_2;
+expression_statement_1
+ semicolon .emit OP_PUSH_VOID .emit OP_END;
+expression_statement_2
+ expression .and semicolon .emit OP_END;
+
+/*
+ <selection_statement> ::= "if" "(" <expression> ")" <selection_rest_statement>
+*/
+selection_statement
+ "if" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and
+ rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;
+
+/*
+ <selection_rest_statement> ::= <statement> "else" <statement>
+ | <statement>
+*/
+selection_rest_statement
+ statement .and selection_rest_statement_1;
+selection_rest_statement_1
+ selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;
+selection_rest_statement_2
+ "else" .and optional_space .and statement;
+
+/*
+ <condition> ::= <expression>
+ | <fully_specified_type> <identifier> "=" <initializer>
+
+note: if <condition_1> is executed, the emit format must match <declaration> emit format
+*/
+condition
+ condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or
+ condition_3 .emit OP_EXPRESSION;
+condition_1
+ condition_1_nospace .or condition_1_space;
+condition_1_nospace
+ fully_specified_type_nospace .and condition_2;
+condition_1_space
+ fully_specified_type_space .and space .and condition_2;
+condition_2
+ identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and
+ initializer .and .true .emit DECLARATOR_NONE;
+condition_3
+ expression .and .true .emit OP_END;
+
+/*
+ <iteration_statement> ::= "while" "(" <condition> ")" <statement_no_new_scope>
+ | "do" <statement> "while" "(" <expression> ")" ";"
+ | "for" "(" <for_init_statement> <for_rest_statement> ")"
+ <statement_no_new_scope>
+*/
+iteration_statement
+ iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;
+iteration_statement_1
+ "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and
+ rparen .error RPAREN_EXPECTED .and statement_no_new_scope;
+iteration_statement_2
+ "do" .emit OP_DO .and statement_space .and "while" .and lparen .error LPAREN_EXPECTED .and
+ expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;
+iteration_statement_3
+ "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and
+ for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;
+
+/*
+ <for_init_statement> ::= <expression_statement>
+ | <declaration_statement>
+*/
+for_init_statement
+ expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;
+
+/*
+ <conditionopt> ::= <condition>
+ | ""
+
+note: <conditionopt> is used only by "for" statement - if <condition> is ommitted, parser
+ simulates default behaviour, that is simulates "true" expression
+*/
+conditionopt
+ condition .or
+ .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\0' .emit OP_END;
+
+/*
+ <for_rest_statement> ::= <conditionopt> ";"
+ | <conditionopt> ";" <expression>
+*/
+for_rest_statement
+ conditionopt .and semicolon .and for_rest_statement_1;
+for_rest_statement_1
+ for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;
+for_rest_statement_2
+ expression .and .true .emit OP_END;
+
+/*
+ <jump_statement> ::= "continue" ";"
+ | "break" ";"
+ | "return" ";"
+ | "return" <expression> ";"
+ | "discard" ";" // Fragment shader only.
+*/
+jump_statement
+ jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or
+ .if (shader_type == 1) jump_statement_5;
+jump_statement_1
+ "continue" .and semicolon .emit OP_CONTINUE;
+jump_statement_2
+ "break" .and semicolon .emit OP_BREAK;
+jump_statement_3
+ "return" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;
+jump_statement_4
+ "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;
+jump_statement_5
+ "discard" .and semicolon .emit OP_DISCARD;
+
+/*
+ <__asm_statement> ::= "__asm" <identifier> <asm_arguments> ";"
+
+note: this is an extension to the standard language specification - normally slang disallows
+ __asm statements
+*/
+__asm_statement
+ "__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;
+
+/*
+ <asm_arguments> ::= <asm_argument>
+ | <asm_arguments> "," <asm_argument>
+
+note: this is an extension to the standard language specification - normally slang disallows
+ __asm statements
+*/
+asm_arguments
+ asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;
+asm_arguments_1
+ comma .and asm_argument .and .true .emit OP_END;
+
+/*
+ <asm_argument> ::= <variable_identifier>
+ | <floatconstant>
+
+note: this is an extension to the standard language specification - normally slang disallows
+ __asm statements
+*/
+asm_argument
+ variable_identifier .or floatconstant;
+
+/*
+ <translation_unit> ::= <external_declaration>
+ | <translation_unit> <external_declaration>
+*/
+translation_unit
+ optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and
+ .loop external_declaration .and optional_space .and
+ '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;
+
+/*
+ <external_declaration> ::= <function_definition>
+ | <declaration>
+*/
+external_declaration
+ function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or
+ declaration .emit EXTERNAL_DECLARATION;
+
+/*
+ <function_definition> :: <function_prototype> <compound_statement_no_new_scope>
+*/
+function_definition
+ function_prototype .and compound_statement_no_new_scope;
+
+/* helper rulez, not part of the official language syntax */
+
+digit_oct
+ '0'-'7';
+
+digit_dec
+ '0'-'9';
+
+digit_hex
+ '0'-'9' .or 'A'-'F' .or 'a'-'f';
+
+id_character_first
+ 'a'-'z' .or 'A'-'Z' .or '_';
+
+id_character_next
+ id_character_first .or digit_dec;
+
+identifier
+ id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\0';
+
+float
+ float_1 .or float_2;
+float_1
+ float_fractional_constant .and float_optional_exponent_part;
+float_2
+ float_digit_sequence .and .true .emit '\0' .and float_exponent_part;
+
+float_fractional_constant
+ float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;
+float_fractional_constant_1
+ float_digit_sequence .and '.' .and float_digit_sequence;
+float_fractional_constant_2
+ float_digit_sequence .and '.' .and .true .emit '\0';
+float_fractional_constant_3
+ '.' .emit '\0' .and float_digit_sequence;
+
+float_optional_exponent_part
+ float_exponent_part .or .true .emit '\0';
+
+float_digit_sequence
+ digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0';
+
+float_exponent_part
+ float_exponent_part_1 .or float_exponent_part_2;
+float_exponent_part_1
+ 'e' .and float_optional_sign .and float_digit_sequence;
+float_exponent_part_2
+ 'E' .and float_optional_sign .and float_digit_sequence;
+
+float_optional_sign
+ float_sign .or .true;
+
+float_sign
+ '+' .or '-' .emit '-';
+
+integer
+ integer_hex .or integer_oct .or integer_dec;
+
+integer_hex
+ '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and
+ .true .emit '\0';
+integer_hex_1
+ 'x' .or 'X';
+
+integer_oct
+ '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\0';
+
+integer_dec
+ digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0';
+
+boolean
+ "true" .emit 2 .emit '1' .emit '\0' .or
+ "false" .emit 2 .emit '0' .emit '\0';
+
+type_name
+ identifier;
+
+field_selection
+ identifier;
+
+floatconstant
+ float .emit OP_PUSH_FLOAT;
+
+intconstant
+ integer .emit OP_PUSH_INT;
+
+boolconstant
+ boolean .emit OP_PUSH_BOOL;
+
+optional_space
+ .loop single_space;
+
+space
+ single_space .and .loop single_space;
+
+single_space
+ white_char .or c_style_comment_block .or cpp_style_comment_block;
+
+white_char
+ ' ' .or '\t' .or new_line .or '\v' .or '\f';
+
+new_line
+ cr_lf .or lf_cr .or '\n' .or '\r';
+
+cr_lf
+ '\r' .and '\n';
+
+lf_cr
+ '\n' .and '\r';
+
+c_style_comment_block
+ '/' .and '*' .and c_style_comment_rest;
+
+c_style_comment_rest
+ .loop c_style_comment_char_no_star .and c_style_comment_rest_1;
+c_style_comment_rest_1
+ c_style_comment_end .or c_style_comment_rest_2;
+c_style_comment_rest_2
+ '*' .and c_style_comment_rest;
+
+c_style_comment_char_no_star
+ '\x2B'-'\xFF' .or '\x01'-'\x29';
+
+c_style_comment_end
+ '*' .and '/';
+
+cpp_style_comment_block
+ '/' .and '/' .and cpp_style_comment_block_1;
+cpp_style_comment_block_1
+ cpp_style_comment_block_2 .or cpp_style_comment_block_3;
+cpp_style_comment_block_2
+ .loop cpp_style_comment_char .and new_line;
+cpp_style_comment_block_3
+ .loop cpp_style_comment_char;
+
+cpp_style_comment_char
+ '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
+
+/* lexical rulez */
+
+/*ampersand
+ optional_space .and '&' .and optional_space;*/
+
+ampersandampersand
+ optional_space .and '&' .and '&' .and optional_space;
+
+/*ampersandequals
+ optional_space .and '&' .and '=' .and optional_space;*/
+
+/*bar
+ optional_space .and '|' .and optional_space;*/
+
+barbar
+ optional_space .and '|' .and '|' .and optional_space;
+
+/*barequals
+ optional_space .and '|' .and '=' .and optional_space;*/
+
+bang
+ optional_space .and '!' .and optional_space;
+
+bangequals
+ optional_space .and '!' .and '=' .and optional_space;
+
+/*caret
+ optional_space .and '^' .and optional_space;*/
+
+caretcaret
+ optional_space .and '^' .and '^' .and optional_space;
+
+/*caretequals
+ optional_space .and '^' .and '=' .and optional_space;*/
+
+colon
+ optional_space .and ':' .and optional_space;
+
+comma
+ optional_space .and ',' .and optional_space;
+
+dot
+ optional_space .and '.' .and optional_space;
+
+equals
+ optional_space .and '=' .and optional_space;
+
+equalsequals
+ optional_space .and '=' .and '=' .and optional_space;
+
+greater
+ optional_space .and '>' .and optional_space;
+
+greaterequals
+ optional_space .and '>' .and '=' .and optional_space;
+
+/*greatergreater
+ optional_space .and '>' .and '>' .and optional_space;*/
+
+/*greatergreaterequals
+ optional_space .and '>' .and '>' .and '=' .and optional_space;*/
+
+lbrace
+ optional_space .and '{' .and optional_space;
+
+lbracket
+ optional_space .and '[' .and optional_space;
+
+less
+ optional_space .and '<' .and optional_space;
+
+lessequals
+ optional_space .and '<' .and '=' .and optional_space;
+
+/*lessless
+ optional_space .and '<' .and '<' .and optional_space;*/
+
+/*lesslessequals
+ optional_space .and '<' .and '<' .and '=' .and optional_space;*/
+
+lparen
+ optional_space .and '(' .and optional_space;
+
+minus
+ optional_space .and '-' .and optional_space;
+
+minusequals
+ optional_space .and '-' .and '=' .and optional_space;
+
+minusminus
+ optional_space .and '-' .and '-' .and optional_space;
+
+/*percent
+ optional_space .and '%' .and optional_space;*/
+
+/*percentequals
+ optional_space .and '%' .and '=' .and optional_space;*/
+
+plus
+ optional_space .and '+' .and optional_space;
+
+plusequals
+ optional_space .and '+' .and '=' .and optional_space;
+
+plusplus
+ optional_space .and '+' .and '+' .and optional_space;
+
+question
+ optional_space .and '?' .and optional_space;
+
+rbrace
+ optional_space .and '}' .and optional_space;
+
+rbracket
+ optional_space .and ']' .and optional_space;
+
+rparen
+ optional_space .and ')' .and optional_space;
+
+semicolon
+ optional_space .and ';' .and optional_space;
+
+slash
+ optional_space .and '/' .and optional_space;
+
+slashequals
+ optional_space .and '/' .and '=' .and optional_space;
+
+star
+ optional_space .and '*' .and optional_space;
+
+starequals
+ optional_space .and '*' .and '=' .and optional_space;
+
+/*tilde
+ optional_space .and '~' .and optional_space;*/
+
+/* string rulez - these are used internally by the parser when parsing quoted strings */
+
+.string string_lexer;
+
+string_lexer
+ lex_first_identifier_character .and .loop lex_next_identifier_character;
+
+lex_first_identifier_character
+ 'a'-'z' .or 'A'-'Z' .or '_';
+
+lex_next_identifier_character
+ 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';
+
+/* error rulez - these are used by error messages */
+
+err_token
+ '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or
+ '-' .or '+' .or '=' .or '|' .or '\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '"' .or
+ '\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;
+
+err_identifier
+ id_character_first .and .loop id_character_next;
+
-".syntax translation_unit;\n"\r
-".emtcode REVISION 3\n"\r
-".emtcode EXTERNAL_NULL 0\n"\r
-".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n"\r
-".emtcode EXTERNAL_DECLARATION 2\n"\r
-".emtcode DECLARATION_FUNCTION_PROTOTYPE 1\n"\r
-".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n"\r
-".emtcode FUNCTION_ORDINARY 0\n"\r
-".emtcode FUNCTION_CONSTRUCTOR 1\n"\r
-".emtcode FUNCTION_OPERATOR 2\n"\r
-".emtcode OPERATOR_ADDASSIGN 1\n"\r
-".emtcode OPERATOR_SUBASSIGN 2\n"\r
-".emtcode OPERATOR_MULASSIGN 3\n"\r
-".emtcode OPERATOR_DIVASSIGN 4\n"\r
-".emtcode OPERATOR_LOGICALXOR 11\n"\r
-".emtcode OPERATOR_LESS 15\n"\r
-".emtcode OPERATOR_GREATER 16\n"\r
-".emtcode OPERATOR_LESSEQUAL 17\n"\r
-".emtcode OPERATOR_GREATEREQUAL 18\n"\r
-".emtcode OPERATOR_MULTIPLY 21\n"\r
-".emtcode OPERATOR_DIVIDE 22\n"\r
-".emtcode OPERATOR_INCREMENT 24\n"\r
-".emtcode OPERATOR_DECREMENT 25\n"\r
-".emtcode OPERATOR_PLUS 26\n"\r
-".emtcode OPERATOR_MINUS 27\n"\r
-".emtcode OPERATOR_NOT 29\n"\r
-".emtcode DECLARATOR_NONE 0\n"\r
-".emtcode DECLARATOR_NEXT 1\n"\r
-".emtcode VARIABLE_NONE 0\n"\r
-".emtcode VARIABLE_IDENTIFIER 1\n"\r
-".emtcode VARIABLE_INITIALIZER 2\n"\r
-".emtcode VARIABLE_ARRAY_EXPLICIT 3\n"\r
-".emtcode VARIABLE_ARRAY_UNKNOWN 4\n"\r
-".emtcode TYPE_QUALIFIER_NONE 0\n"\r
-".emtcode TYPE_QUALIFIER_CONST 1\n"\r
-".emtcode TYPE_QUALIFIER_ATTRIBUTE 2\n"\r
-".emtcode TYPE_QUALIFIER_VARYING 3\n"\r
-".emtcode TYPE_QUALIFIER_UNIFORM 4\n"\r
-".emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5\n"\r
-".emtcode TYPE_QUALIFIER_FIXEDINPUT 6\n"\r
-".emtcode TYPE_SPECIFIER_VOID 0\n"\r
-".emtcode TYPE_SPECIFIER_BOOL 1\n"\r
-".emtcode TYPE_SPECIFIER_BVEC2 2\n"\r
-".emtcode TYPE_SPECIFIER_BVEC3 3\n"\r
-".emtcode TYPE_SPECIFIER_BVEC4 4\n"\r
-".emtcode TYPE_SPECIFIER_INT 5\n"\r
-".emtcode TYPE_SPECIFIER_IVEC2 6\n"\r
-".emtcode TYPE_SPECIFIER_IVEC3 7\n"\r
-".emtcode TYPE_SPECIFIER_IVEC4 8\n"\r
-".emtcode TYPE_SPECIFIER_FLOAT 9\n"\r
-".emtcode TYPE_SPECIFIER_VEC2 10\n"\r
-".emtcode TYPE_SPECIFIER_VEC3 11\n"\r
-".emtcode TYPE_SPECIFIER_VEC4 12\n"\r
-".emtcode TYPE_SPECIFIER_MAT2 13\n"\r
-".emtcode TYPE_SPECIFIER_MAT3 14\n"\r
-".emtcode TYPE_SPECIFIER_MAT4 15\n"\r
-".emtcode TYPE_SPECIFIER_SAMPLER1D 16\n"\r
-".emtcode TYPE_SPECIFIER_SAMPLER2D 17\n"\r
-".emtcode TYPE_SPECIFIER_SAMPLER3D 18\n"\r
-".emtcode TYPE_SPECIFIER_SAMPLERCUBE 19\n"\r
-".emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20\n"\r
-".emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21\n"\r
-".emtcode TYPE_SPECIFIER_STRUCT 22\n"\r
-".emtcode TYPE_SPECIFIER_TYPENAME 23\n"\r
-".emtcode FIELD_NONE 0\n"\r
-".emtcode FIELD_NEXT 1\n"\r
-".emtcode FIELD_ARRAY 2\n"\r
-".emtcode OP_END 0\n"\r
-".emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1\n"\r
-".emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2\n"\r
-".emtcode OP_DECLARE 3\n"\r
-".emtcode OP_ASM 4\n"\r
-".emtcode OP_BREAK 5\n"\r
-".emtcode OP_CONTINUE 6\n"\r
-".emtcode OP_DISCARD 7\n"\r
-".emtcode OP_RETURN 8\n"\r
-".emtcode OP_EXPRESSION 9\n"\r
-".emtcode OP_IF 10\n"\r
-".emtcode OP_WHILE 11\n"\r
-".emtcode OP_DO 12\n"\r
-".emtcode OP_FOR 13\n"\r
-".emtcode OP_PUSH_VOID 14\n"\r
-".emtcode OP_PUSH_BOOL 15\n"\r
-".emtcode OP_PUSH_INT 16\n"\r
-".emtcode OP_PUSH_FLOAT 17\n"\r
-".emtcode OP_PUSH_IDENTIFIER 18\n"\r
-".emtcode OP_SEQUENCE 19\n"\r
-".emtcode OP_ASSIGN 20\n"\r
-".emtcode OP_ADDASSIGN 21\n"\r
-".emtcode OP_SUBASSIGN 22\n"\r
-".emtcode OP_MULASSIGN 23\n"\r
-".emtcode OP_DIVASSIGN 24\n"\r
-".emtcode OP_SELECT 31\n"\r
-".emtcode OP_LOGICALOR 32\n"\r
-".emtcode OP_LOGICALXOR 33\n"\r
-".emtcode OP_LOGICALAND 34\n"\r
-".emtcode OP_EQUAL 38\n"\r
-".emtcode OP_NOTEQUAL 39\n"\r
-".emtcode OP_LESS 40\n"\r
-".emtcode OP_GREATER 41\n"\r
-".emtcode OP_LESSEQUAL 42\n"\r
-".emtcode OP_GREATEREQUAL 43\n"\r
-".emtcode OP_ADD 46\n"\r
-".emtcode OP_SUBTRACT 47\n"\r
-".emtcode OP_MULTIPLY 48\n"\r
-".emtcode OP_DIVIDE 49\n"\r
-".emtcode OP_PREINCREMENT 51\n"\r
-".emtcode OP_PREDECREMENT 52\n"\r
-".emtcode OP_PLUS 53\n"\r
-".emtcode OP_MINUS 54\n"\r
-".emtcode OP_NOT 56\n"\r
-".emtcode OP_SUBSCRIPT 57\n"\r
-".emtcode OP_CALL 58\n"\r
-".emtcode OP_FIELD 59\n"\r
-".emtcode OP_POSTINCREMENT 60\n"\r
-".emtcode OP_POSTDECREMENT 61\n"\r
-".emtcode PARAM_QUALIFIER_IN 0\n"\r
-".emtcode PARAM_QUALIFIER_OUT 1\n"\r
-".emtcode PARAM_QUALIFIER_INOUT 2\n"\r
-".emtcode PARAMETER_NONE 0\n"\r
-".emtcode PARAMETER_NEXT 1\n"\r
-".emtcode PARAMETER_ARRAY_NOT_PRESENT 0\n"\r
-".emtcode PARAMETER_ARRAY_PRESENT 1\n"\r
-".errtext INVALID_EXTERNAL_DECLARATION \"error 2001: invalid external declaration\"\n"\r
-".errtext INVALID_OPERATOR_OVERRIDE \"error 2002: invalid operator override\"\n"\r
-".errtext LBRACE_EXPECTED \"error 2003: '{' expected but '$err_token$' found\"\n"\r
-".errtext LPAREN_EXPECTED \"error 2004: '(' expected but '$err_token$' found\"\n"\r
-".errtext RPAREN_EXPECTED \"error 2005: ')' expected but '$err_token$' found\"\n"\r
-".regbyte parsing_builtin 0\n"\r
-".regbyte shader_type 0\n"\r
-"variable_identifier\n"\r
-" identifier .emit OP_PUSH_IDENTIFIER;\n"\r
-"primary_expression\n"\r
-" floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;\n"\r
-"primary_expression_1\n"\r
-" lparen .and expression .and rparen;\n"\r
-"postfix_expression\n"\r
-" postfix_expression_1 .and .loop postfix_expression_2;\n"\r
-"postfix_expression_1\n"\r
-" function_call .or primary_expression;\n"\r
-"postfix_expression_2\n"\r
-" postfix_expression_3 .or postfix_expression_4 .or\n"\r
-" plusplus .emit OP_POSTINCREMENT .or\n"\r
-" minusminus .emit OP_POSTDECREMENT;\n"\r
-"postfix_expression_3\n"\r
-" lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;\n"\r
-"postfix_expression_4\n"\r
-" dot .and field_selection .emit OP_FIELD;\n"\r
-"integer_expression\n"\r
-" expression;\n"\r
-"function_call\n"\r
-" function_call_generic .emit OP_CALL .and .true .emit OP_END;\n"\r
-"function_call_generic\n"\r
-" function_call_generic_1 .or function_call_generic_2;\n"\r
-"function_call_generic_1\n"\r
-" function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;\n"\r
-"function_call_generic_2\n"\r
-" function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;\n"\r
-"function_call_header_no_parameters\n"\r
-" function_call_header .and function_call_header_no_parameters_1;\n"\r
-"function_call_header_no_parameters_1\n"\r
-" \"void\" .or .true;\n"\r
-"function_call_header_with_parameters\n"\r
-" function_call_header .and assignment_expression .and .true .emit OP_END .and\n"\r
-" .loop function_call_header_with_parameters_1;\n"\r
-"function_call_header_with_parameters_1\n"\r
-" comma .and assignment_expression .and .true .emit OP_END;\n"\r
-"function_call_header\n"\r
-" function_identifier .and lparen;\n"\r
-"function_identifier\n"\r
-" identifier;\n"\r
-"unary_expression\n"\r
-" postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n"\r
-" unary_expression_4 .or unary_expression_5;\n"\r
-"unary_expression_1\n"\r
-" plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;\n"\r
-"unary_expression_2\n"\r
-" minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;\n"\r
-"unary_expression_3\n"\r
-" plus .and unary_expression .and .true .emit OP_PLUS;\n"\r
-"unary_expression_4\n"\r
-" minus .and unary_expression .and .true .emit OP_MINUS;\n"\r
-"unary_expression_5\n"\r
-" bang .and unary_expression .and .true .emit OP_NOT;\n"\r
-"multiplicative_expression\n"\r
-" unary_expression .and .loop multiplicative_expression_1;\n"\r
-"multiplicative_expression_1\n"\r
-" multiplicative_expression_2 .or multiplicative_expression_3;\n"\r
-"multiplicative_expression_2\n"\r
-" star .and unary_expression .and .true .emit OP_MULTIPLY;\n"\r
-"multiplicative_expression_3\n"\r
-" slash .and unary_expression .and .true .emit OP_DIVIDE;\n"\r
-"additive_expression\n"\r
-" multiplicative_expression .and .loop additive_expression_1;\n"\r
-"additive_expression_1\n"\r
-" additive_expression_2 .or additive_expression_3;\n"\r
-"additive_expression_2\n"\r
-" plus .and multiplicative_expression .and .true .emit OP_ADD;\n"\r
-"additive_expression_3\n"\r
-" minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n"\r
-"shift_expression\n"\r
-" additive_expression;\n"\r
-"relational_expression\n"\r
-" shift_expression .and .loop relational_expression_1;\n"\r
-"relational_expression_1\n"\r
-" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n"\r
-" relational_expression_5;\n"\r
-"relational_expression_2\n"\r
-" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n"\r
-"relational_expression_3\n"\r
-" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n"\r
-"relational_expression_4\n"\r
-" less .and shift_expression .and .true .emit OP_LESS;\n"\r
-"relational_expression_5\n"\r
-" greater .and shift_expression .and .true .emit OP_GREATER;\n"\r
-"equality_expression\n"\r
-" relational_expression .and .loop equality_expression_1;\n"\r
-"equality_expression_1\n"\r
-" equality_expression_2 .or equality_expression_3;\n"\r
-"equality_expression_2\n"\r
-" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n"\r
-"equality_expression_3\n"\r
-" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n"\r
-"and_expression\n"\r
-" equality_expression;\n"\r
-"exclusive_or_expression\n"\r
-" and_expression;\n"\r
-"inclusive_or_expression\n"\r
-" exclusive_or_expression;\n"\r
-"logical_and_expression\n"\r
-" inclusive_or_expression .and .loop logical_and_expression_1;\n"\r
-"logical_and_expression_1\n"\r
-" ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;\n"\r
-"logical_xor_expression\n"\r
-" logical_and_expression .and .loop logical_xor_expression_1;\n"\r
-"logical_xor_expression_1\n"\r
-" caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;\n"\r
-"logical_or_expression\n"\r
-" logical_xor_expression .and .loop logical_or_expression_1;\n"\r
-"logical_or_expression_1\n"\r
-" barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;\n"\r
-"conditional_expression\n"\r
-" logical_or_expression .and .loop conditional_expression_1;\n"\r
-"conditional_expression_1\n"\r
-" question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;\n"\r
-"assignment_expression\n"\r
-" assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or\n"\r
-" assignment_expression_4 .or assignment_expression_5 .or conditional_expression;\n"\r
-"assignment_expression_1\n"\r
-" unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;\n"\r
-"assignment_expression_2\n"\r
-" unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;\n"\r
-"assignment_expression_3\n"\r
-" unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;\n"\r
-"assignment_expression_4\n"\r
-" unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;\n"\r
-"assignment_expression_5\n"\r
-" unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;\n"\r
-"expression\n"\r
-" assignment_expression .and .loop expression_1;\n"\r
-"expression_1\n"\r
-" comma .and assignment_expression .and .true .emit OP_SEQUENCE;\n"\r
-"constant_expression\n"\r
-" conditional_expression .and .true .emit OP_END;\n"\r
-"declaration\n"\r
-" declaration_1 .or declaration_2;\n"\r
-"declaration_1\n"\r
-" function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;\n"\r
-"declaration_2\n"\r
-" init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\n"\r
-"function_prototype\n"\r
-" function_prototype_1 .or function_prototype_2;\n"\r
-"function_prototype_1\n"\r
-" function_header .and \"void\" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n"\r
-"function_prototype_2\n"\r
-" function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n"\r
-"function_declarator\n"\r
-" function_header_with_parameters .or function_header;\n"\r
-"function_header_with_parameters\n"\r
-" function_header .and parameter_declaration .and .loop function_header_with_parameters_1;\n"\r
-"function_header_with_parameters_1\n"\r
-" comma .and parameter_declaration;\n"\r
-"function_header\n"\r
-" function_header_nospace .or function_header_space;\n"\r
-"function_header_space\n"\r
-" fully_specified_type_space .and space .and function_decl_identifier .and lparen;\n"\r
-"function_header_nospace\n"\r
-" fully_specified_type_nospace .and function_decl_identifier .and lparen;\n"\r
-"function_decl_identifier\n"\r
-" .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\n"\r
-" .if (parsing_builtin != 0) \"__constructor\" .emit FUNCTION_CONSTRUCTOR .or\n"\r
-" identifier .emit FUNCTION_ORDINARY;\n"\r
-"__operator\n"\r
-" \"__operator\" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;\n"\r
-"overriden_operator\n"\r
-" plusplus .emit OPERATOR_INCREMENT .or\n"\r
-" plusequals .emit OPERATOR_ADDASSIGN .or\n"\r
-" plus .emit OPERATOR_PLUS .or\n"\r
-" minusminus .emit OPERATOR_DECREMENT .or\n"\r
-" minusequals .emit OPERATOR_SUBASSIGN .or\n"\r
-" minus .emit OPERATOR_MINUS .or\n"\r
-" bang .emit OPERATOR_NOT .or\n"\r
-" starequals .emit OPERATOR_MULASSIGN .or\n"\r
-" star .emit OPERATOR_MULTIPLY .or\n"\r
-" slashequals .emit OPERATOR_DIVASSIGN .or\n"\r
-" slash .emit OPERATOR_DIVIDE .or\n"\r
-" lessequals .emit OPERATOR_LESSEQUAL .or\n"\r
-" \n"\r
-" \n"\r
-" less .emit OPERATOR_LESS .or\n"\r
-" greaterequals .emit OPERATOR_GREATEREQUAL .or\n"\r
-" \n"\r
-" \n"\r
-" greater .emit OPERATOR_GREATER .or\n"\r
-" \n"\r
-" \n"\r
-" \n"\r
-" \n"\r
-" \n"\r
-" \n"\r
-" \n"\r
-" \n"\r
-" caretcaret .emit OPERATOR_LOGICALXOR ;\n"\r
-"parameter_declarator\n"\r
-" parameter_declarator_nospace .or parameter_declarator_space;\n"\r
-"parameter_declarator_nospace\n"\r
-" type_specifier_nospace .and identifier .and parameter_declarator_1;\n"\r
-"parameter_declarator_space\n"\r
-" type_specifier_space .and space .and identifier .and parameter_declarator_1;\n"\r
-"parameter_declarator_1\n"\r
-" parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\n"\r
-" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n"\r
-"parameter_declarator_2\n"\r
-" lbracket .and constant_expression .and rbracket;\n"\r
-"parameter_declaration\n"\r
-" parameter_declaration_1 .emit PARAMETER_NEXT;\n"\r
-"parameter_declaration_1\n"\r
-" parameter_declaration_2 .or parameter_declaration_3;\n"\r
-"parameter_declaration_2\n"\r
-" type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;\n"\r
-"parameter_declaration_3\n"\r
-" parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\n"\r
-"parameter_declaration_4\n"\r
-" parameter_declarator .or parameter_type_specifier;\n"\r
-"parameter_qualifier\n"\r
-" parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\n"\r
-"parameter_qualifier_1\n"\r
-" parameter_qualifier_2 .and space;\n"\r
-"parameter_qualifier_2\n"\r
-" \"in\" .emit PARAM_QUALIFIER_IN .or\n"\r
-" \"out\" .emit PARAM_QUALIFIER_OUT .or\n"\r
-" \"inout\" .emit PARAM_QUALIFIER_INOUT;\n"\r
-"parameter_type_specifier\n"\r
-" parameter_type_specifier_1 .and .true .emit '\\0' .and parameter_type_specifier_2;\n"\r
-"parameter_type_specifier_1\n"\r
-" type_specifier_nospace .or type_specifier_space;\n"\r
-"parameter_type_specifier_2\n"\r
-" parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\n"\r
-" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n"\r
-"parameter_type_specifier_3\n"\r
-" lbracket .and constant_expression .and rbracket;\n"\r
-"init_declarator_list\n"\r
-" single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and\n"\r
-" .true .emit DECLARATOR_NONE;\n"\r
-"init_declarator_list_1\n"\r
-" comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;\n"\r
-"init_declarator_list_2\n"\r
-" init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;\n"\r
-"init_declarator_list_3\n"\r
-" equals .and initializer .emit VARIABLE_INITIALIZER;\n"\r
-"init_declarator_list_4\n"\r
-" lbracket .and init_declarator_list_5 .and rbracket;\n"\r
-"init_declarator_list_5\n"\r
-" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n"\r
-"single_declaration\n"\r
-" single_declaration_nospace .or single_declaration_space;\n"\r
-"single_declaration_space\n"\r
-" fully_specified_type_space .and single_declaration_space_1;\n"\r
-"single_declaration_nospace\n"\r
-" fully_specified_type_nospace .and single_declaration_nospace_1;\n"\r
-"single_declaration_space_1\n"\r
-" single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n"\r
-"single_declaration_nospace_1\n"\r
-" single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n"\r
-"single_declaration_space_2\n"\r
-" space .and identifier .and single_declaration_3;\n"\r
-"single_declaration_nospace_2\n"\r
-" identifier .and single_declaration_3;\n"\r
-"single_declaration_3\n"\r
-" single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\n"\r
-"single_declaration_4\n"\r
-" equals .and initializer .emit VARIABLE_INITIALIZER;\n"\r
-"single_declaration_5\n"\r
-" lbracket .and single_declaration_6 .and rbracket;\n"\r
-"single_declaration_6\n"\r
-" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n"\r
-"fully_specified_type_space\n"\r
-" fully_specified_type_1 .and type_specifier_space;\n"\r
-"fully_specified_type_nospace\n"\r
-" fully_specified_type_1 .and type_specifier_nospace;\n"\r
-"fully_specified_type_1\n"\r
-" fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;\n"\r
-"fully_specified_type_2\n"\r
-" type_qualifier .and space;\n"\r
-"type_qualifier\n"\r
-" \"const\" .emit TYPE_QUALIFIER_CONST .or\n"\r
-" .if (shader_type == 2) \"attribute\" .emit TYPE_QUALIFIER_ATTRIBUTE .or\n"\r
-" \"varying\" .emit TYPE_QUALIFIER_VARYING .or\n"\r
-" \"uniform\" .emit TYPE_QUALIFIER_UNIFORM .or\n"\r
-" .if (parsing_builtin != 0) \"__fixed_output\" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\n"\r
-" .if (parsing_builtin != 0) \"__fixed_input\" .emit TYPE_QUALIFIER_FIXEDINPUT;\n"\r
-"type_specifier_space\n"\r
-" \"void\" .emit TYPE_SPECIFIER_VOID .or\n"\r
-" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n"\r
-" \"int\" .emit TYPE_SPECIFIER_INT .or\n"\r
-" \"bool\" .emit TYPE_SPECIFIER_BOOL .or\n"\r
-" \"vec2\" .emit TYPE_SPECIFIER_VEC2 .or\n"\r
-" \"vec3\" .emit TYPE_SPECIFIER_VEC3 .or\n"\r
-" \"vec4\" .emit TYPE_SPECIFIER_VEC4 .or\n"\r
-" \"bvec2\" .emit TYPE_SPECIFIER_BVEC2 .or\n"\r
-" \"bvec3\" .emit TYPE_SPECIFIER_BVEC3 .or\n"\r
-" \"bvec4\" .emit TYPE_SPECIFIER_BVEC4 .or\n"\r
-" \"ivec2\" .emit TYPE_SPECIFIER_IVEC2 .or\n"\r
-" \"ivec3\" .emit TYPE_SPECIFIER_IVEC3 .or\n"\r
-" \"ivec4\" .emit TYPE_SPECIFIER_IVEC4 .or\n"\r
-" \"mat2\" .emit TYPE_SPECIFIER_MAT2 .or\n"\r
-" \"mat3\" .emit TYPE_SPECIFIER_MAT3 .or\n"\r
-" \"mat4\" .emit TYPE_SPECIFIER_MAT4 .or\n"\r
-" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n"\r
-" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n"\r
-" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n"\r
-" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n"\r
-" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n"\r
-" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n"\r
-" type_name .emit TYPE_SPECIFIER_TYPENAME;\n"\r
-"type_specifier_nospace\n"\r
-" struct_specifier .emit TYPE_SPECIFIER_STRUCT;\n"\r
-"struct_specifier\n"\r
-" \"struct\" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\n"\r
-" struct_declaration_list .and rbrace .emit FIELD_NONE;\n"\r
-"struct_specifier_1\n"\r
-" struct_specifier_2 .or .true .emit '\\0';\n"\r
-"struct_specifier_2\n"\r
-" space .and identifier;\n"\r
-"struct_declaration_list\n"\r
-" struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\n"\r
-"struct_declaration\n"\r
-" struct_declaration_nospace .or struct_declaration_space;\n"\r
-"struct_declaration_space\n"\r
-" type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n"\r
-"struct_declaration_nospace\n"\r
-" type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n"\r
-"struct_declarator_list\n"\r
-" struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\n"\r
-"struct_declarator_list_1\n"\r
-" comma .and struct_declarator;\n"\r
-"struct_declarator\n"\r
-" identifier .and struct_declarator_1;\n"\r
-"struct_declarator_1\n"\r
-" struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;\n"\r
-"struct_declarator_2\n"\r
-" lbracket .and constant_expression .and rbracket;\n"\r
-"initializer\n"\r
-" assignment_expression .and .true .emit OP_END;\n"\r
-"declaration_statement\n"\r
-" declaration;\n"\r
-"statement\n"\r
-" compound_statement .or simple_statement;\n"\r
-"statement_space\n"\r
-" compound_statement .or statement_space_1;\n"\r
-"statement_space_1\n"\r
-" space .and simple_statement;\n"\r
-"simple_statement\n"\r
-" .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\n"\r
-" selection_statement .or\n"\r
-" iteration_statement .or\n"\r
-" jump_statement .or\n"\r
-" expression_statement .emit OP_EXPRESSION .or\n"\r
-" declaration_statement .emit OP_DECLARE;\n"\r
-"compound_statement\n"\r
-" compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;\n"\r
-"compound_statement_1\n"\r
-" compound_statement_2 .or compound_statement_3;\n"\r
-"compound_statement_2\n"\r
-" lbrace .and rbrace;\n"\r
-"compound_statement_3\n"\r
-" lbrace .and statement_list .and rbrace;\n"\r
-"statement_no_new_scope\n"\r
-" compound_statement_no_new_scope .or simple_statement;\n"\r
-"compound_statement_no_new_scope\n"\r
-" compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\n"\r
-"compound_statement_no_new_scope_1\n"\r
-" compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;\n"\r
-"compound_statement_no_new_scope_2\n"\r
-" lbrace .and rbrace;\n"\r
-"compound_statement_no_new_scope_3\n"\r
-" lbrace .and statement_list .and rbrace;\n"\r
-"statement_list\n"\r
-" statement .and .loop statement;\n"\r
-"expression_statement\n"\r
-" expression_statement_1 .or expression_statement_2;\n"\r
-"expression_statement_1\n"\r
-" semicolon .emit OP_PUSH_VOID .emit OP_END;\n"\r
-"expression_statement_2\n"\r
-" expression .and semicolon .emit OP_END;\n"\r
-"selection_statement\n"\r
-" \"if\" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and\n"\r
-" rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;\n"\r
-"selection_rest_statement\n"\r
-" statement .and selection_rest_statement_1;\n"\r
-"selection_rest_statement_1\n"\r
-" selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\n"\r
-"selection_rest_statement_2\n"\r
-" \"else\" .and optional_space .and statement;\n"\r
-"condition\n"\r
-" condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\n"\r
-" condition_3 .emit OP_EXPRESSION;\n"\r
-"condition_1\n"\r
-" condition_1_nospace .or condition_1_space;\n"\r
-"condition_1_nospace\n"\r
-" fully_specified_type_nospace .and condition_2;\n"\r
-"condition_1_space\n"\r
-" fully_specified_type_space .and space .and condition_2;\n"\r
-"condition_2\n"\r
-" identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and\n"\r
-" initializer .and .true .emit DECLARATOR_NONE;\n"\r
-"condition_3\n"\r
-" expression .and .true .emit OP_END;\n"\r
-"iteration_statement\n"\r
-" iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\n"\r
-"iteration_statement_1\n"\r
-" \"while\" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\n"\r
-" rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\n"\r
-"iteration_statement_2\n"\r
-" \"do\" .emit OP_DO .and statement_space .and \"while\" .and lparen .error LPAREN_EXPECTED .and\n"\r
-" expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\n"\r
-"iteration_statement_3\n"\r
-" \"for\" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\n"\r
-" for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\n"\r
-"for_init_statement\n"\r
-" expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;\n"\r
-"conditionopt\n"\r
-" condition .or\n"\r
-" .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\\0' .emit OP_END;\n"\r
-"for_rest_statement\n"\r
-" conditionopt .and semicolon .and for_rest_statement_1;\n"\r
-"for_rest_statement_1\n"\r
-" for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;\n"\r
-"for_rest_statement_2\n"\r
-" expression .and .true .emit OP_END;\n"\r
-"jump_statement\n"\r
-" jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or\n"\r
-" .if (shader_type == 1) jump_statement_5;\n"\r
-"jump_statement_1\n"\r
-" \"continue\" .and semicolon .emit OP_CONTINUE;\n"\r
-"jump_statement_2\n"\r
-" \"break\" .and semicolon .emit OP_BREAK;\n"\r
-"jump_statement_3\n"\r
-" \"return\" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;\n"\r
-"jump_statement_4\n"\r
-" \"return\" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\n"\r
-"jump_statement_5\n"\r
-" \"discard\" .and semicolon .emit OP_DISCARD;\n"\r
-"__asm_statement\n"\r
-" \"__asm\" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\n"\r
-"asm_arguments\n"\r
-" asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\n"\r
-"asm_arguments_1\n"\r
-" comma .and asm_argument .and .true .emit OP_END;\n"\r
-"asm_argument\n"\r
-" variable_identifier .or floatconstant;\n"\r
-"translation_unit\n"\r
-" optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n"\r
-" .loop external_declaration .and optional_space .and\n"\r
-" '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n"\r
-"external_declaration\n"\r
-" function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n"\r
-" declaration .emit EXTERNAL_DECLARATION;\n"\r
-"function_definition\n"\r
-" function_prototype .and compound_statement_no_new_scope;\n"\r
-"digit_oct\n"\r
-" '0'-'7';\n"\r
-"digit_dec\n"\r
-" '0'-'9';\n"\r
-"digit_hex\n"\r
-" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n"\r
-"id_character_first\n"\r
-" 'a'-'z' .or 'A'-'Z' .or '_';\n"\r
-"id_character_next\n"\r
-" id_character_first .or digit_dec;\n"\r
-"identifier\n"\r
-" id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\\0';\n"\r
-"float\n"\r
-" float_1 .or float_2;\n"\r
-"float_1\n"\r
-" float_fractional_constant .and float_optional_exponent_part;\n"\r
-"float_2\n"\r
-" float_digit_sequence .and .true .emit '\\0' .and float_exponent_part;\n"\r
-"float_fractional_constant\n"\r
-" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n"\r
-"float_fractional_constant_1\n"\r
-" float_digit_sequence .and '.' .and float_digit_sequence;\n"\r
-"float_fractional_constant_2\n"\r
-" float_digit_sequence .and '.' .and .true .emit '\\0';\n"\r
-"float_fractional_constant_3\n"\r
-" '.' .emit '\\0' .and float_digit_sequence;\n"\r
-"float_optional_exponent_part\n"\r
-" float_exponent_part .or .true .emit '\\0';\n"\r
-"float_digit_sequence\n"\r
-" digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n"\r
-"float_exponent_part\n"\r
-" float_exponent_part_1 .or float_exponent_part_2;\n"\r
-"float_exponent_part_1\n"\r
-" 'e' .and float_optional_sign .and float_digit_sequence;\n"\r
-"float_exponent_part_2\n"\r
-" 'E' .and float_optional_sign .and float_digit_sequence;\n"\r
-"float_optional_sign\n"\r
-" float_sign .or .true;\n"\r
-"float_sign\n"\r
-" '+' .or '-' .emit '-';\n"\r
-"integer\n"\r
-" integer_hex .or integer_oct .or integer_dec;\n"\r
-"integer_hex\n"\r
-" '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and\n"\r
-" .true .emit '\\0';\n"\r
-"integer_hex_1\n"\r
-" 'x' .or 'X';\n"\r
-"integer_oct\n"\r
-" '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\\0';\n"\r
-"integer_dec\n"\r
-" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n"\r
-"boolean\n"\r
-" \"true\" .emit 2 .emit '1' .emit '\\0' .or\n"\r
-" \"false\" .emit 2 .emit '0' .emit '\\0';\n"\r
-"type_name\n"\r
-" identifier;\n"\r
-"field_selection\n"\r
-" identifier;\n"\r
-"floatconstant\n"\r
-" float .emit OP_PUSH_FLOAT;\n"\r
-"intconstant\n"\r
-" integer .emit OP_PUSH_INT;\n"\r
-"boolconstant\n"\r
-" boolean .emit OP_PUSH_BOOL;\n"\r
-"optional_space\n"\r
-" .loop single_space;\n"\r
-"space\n"\r
-" single_space .and .loop single_space;\n"\r
-"single_space\n"\r
-" white_char .or c_style_comment_block .or cpp_style_comment_block;\n"\r
-"white_char\n"\r
-" ' ' .or '\\t' .or new_line .or '\\v' .or '\\f';\n"\r
-"new_line\n"\r
-" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"\r
-"cr_lf\n"\r
-" '\\r' .and '\\n';\n"\r
-"lf_cr\n"\r
-" '\\n' .and '\\r';\n"\r
-"c_style_comment_block\n"\r
-" '/' .and '*' .and c_style_comment_rest;\n"\r
-"c_style_comment_rest\n"\r
-" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"\r
-"c_style_comment_rest_1\n"\r
-" c_style_comment_end .or c_style_comment_rest_2;\n"\r
-"c_style_comment_rest_2\n"\r
-" '*' .and c_style_comment_rest;\n"\r
-"c_style_comment_char_no_star\n"\r
-" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"\r
-"c_style_comment_end\n"\r
-" '*' .and '/';\n"\r
-"cpp_style_comment_block\n"\r
-" '/' .and '/' .and cpp_style_comment_block_1;\n"\r
-"cpp_style_comment_block_1\n"\r
-" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"\r
-"cpp_style_comment_block_2\n"\r
-" .loop cpp_style_comment_char .and new_line;\n"\r
-"cpp_style_comment_block_3\n"\r
-" .loop cpp_style_comment_char;\n"\r
-"cpp_style_comment_char\n"\r
-" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"\r
-"ampersandampersand\n"\r
-" optional_space .and '&' .and '&' .and optional_space;\n"\r
-"barbar\n"\r
-" optional_space .and '|' .and '|' .and optional_space;\n"\r
-"bang\n"\r
-" optional_space .and '!' .and optional_space;\n"\r
-"bangequals\n"\r
-" optional_space .and '!' .and '=' .and optional_space;\n"\r
-"caretcaret\n"\r
-" optional_space .and '^' .and '^' .and optional_space;\n"\r
-"colon\n"\r
-" optional_space .and ':' .and optional_space;\n"\r
-"comma\n"\r
-" optional_space .and ',' .and optional_space;\n"\r
-"dot\n"\r
-" optional_space .and '.' .and optional_space;\n"\r
-"equals\n"\r
-" optional_space .and '=' .and optional_space;\n"\r
-"equalsequals\n"\r
-" optional_space .and '=' .and '=' .and optional_space;\n"\r
-"greater\n"\r
-" optional_space .and '>' .and optional_space;\n"\r
-"greaterequals\n"\r
-" optional_space .and '>' .and '=' .and optional_space;\n"\r
-"lbrace\n"\r
-" optional_space .and '{' .and optional_space;\n"\r
-"lbracket\n"\r
-" optional_space .and '[' .and optional_space;\n"\r
-"less\n"\r
-" optional_space .and '<' .and optional_space;\n"\r
-"lessequals\n"\r
-" optional_space .and '<' .and '=' .and optional_space;\n"\r
-"lparen\n"\r
-" optional_space .and '(' .and optional_space;\n"\r
-"minus\n"\r
-" optional_space .and '-' .and optional_space;\n"\r
-"minusequals\n"\r
-" optional_space .and '-' .and '=' .and optional_space;\n"\r
-"minusminus\n"\r
-" optional_space .and '-' .and '-' .and optional_space;\n"\r
-"plus\n"\r
-" optional_space .and '+' .and optional_space;\n"\r
-"plusequals\n"\r
-" optional_space .and '+' .and '=' .and optional_space;\n"\r
-"plusplus\n"\r
-" optional_space .and '+' .and '+' .and optional_space;\n"\r
-"question\n"\r
-" optional_space .and '?' .and optional_space;\n"\r
-"rbrace\n"\r
-" optional_space .and '}' .and optional_space;\n"\r
-"rbracket\n"\r
-" optional_space .and ']' .and optional_space;\n"\r
-"rparen\n"\r
-" optional_space .and ')' .and optional_space;\n"\r
-"semicolon\n"\r
-" optional_space .and ';' .and optional_space;\n"\r
-"slash\n"\r
-" optional_space .and '/' .and optional_space;\n"\r
-"slashequals\n"\r
-" optional_space .and '/' .and '=' .and optional_space;\n"\r
-"star\n"\r
-" optional_space .and '*' .and optional_space;\n"\r
-"starequals\n"\r
-" optional_space .and '*' .and '=' .and optional_space;\n"\r
-".string string_lexer;\n"\r
-"string_lexer\n"\r
-" lex_first_identifier_character .and .loop lex_next_identifier_character;\n"\r
-"lex_first_identifier_character\n"\r
-" 'a'-'z' .or 'A'-'Z' .or '_';\n"\r
-"lex_next_identifier_character\n"\r
-" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n"\r
-"err_token\n"\r
-" '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or\n"\r
-" '-' .or '+' .or '=' .or '|' .or '\\\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '\"' .or\n"\r
-" '\\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\n"\r
-"err_identifier\n"\r
-" id_character_first .and .loop id_character_next;\n"\r
+".syntax translation_unit;\n"
+".emtcode REVISION 3\n"
+".emtcode EXTERNAL_NULL 0\n"
+".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n"
+".emtcode EXTERNAL_DECLARATION 2\n"
+".emtcode DECLARATION_FUNCTION_PROTOTYPE 1\n"
+".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n"
+".emtcode FUNCTION_ORDINARY 0\n"
+".emtcode FUNCTION_CONSTRUCTOR 1\n"
+".emtcode FUNCTION_OPERATOR 2\n"
+".emtcode OPERATOR_ADDASSIGN 1\n"
+".emtcode OPERATOR_SUBASSIGN 2\n"
+".emtcode OPERATOR_MULASSIGN 3\n"
+".emtcode OPERATOR_DIVASSIGN 4\n"
+".emtcode OPERATOR_LOGICALXOR 11\n"
+".emtcode OPERATOR_LESS 15\n"
+".emtcode OPERATOR_GREATER 16\n"
+".emtcode OPERATOR_LESSEQUAL 17\n"
+".emtcode OPERATOR_GREATEREQUAL 18\n"
+".emtcode OPERATOR_MULTIPLY 21\n"
+".emtcode OPERATOR_DIVIDE 22\n"
+".emtcode OPERATOR_INCREMENT 24\n"
+".emtcode OPERATOR_DECREMENT 25\n"
+".emtcode OPERATOR_PLUS 26\n"
+".emtcode OPERATOR_MINUS 27\n"
+".emtcode OPERATOR_NOT 29\n"
+".emtcode DECLARATOR_NONE 0\n"
+".emtcode DECLARATOR_NEXT 1\n"
+".emtcode VARIABLE_NONE 0\n"
+".emtcode VARIABLE_IDENTIFIER 1\n"
+".emtcode VARIABLE_INITIALIZER 2\n"
+".emtcode VARIABLE_ARRAY_EXPLICIT 3\n"
+".emtcode VARIABLE_ARRAY_UNKNOWN 4\n"
+".emtcode TYPE_QUALIFIER_NONE 0\n"
+".emtcode TYPE_QUALIFIER_CONST 1\n"
+".emtcode TYPE_QUALIFIER_ATTRIBUTE 2\n"
+".emtcode TYPE_QUALIFIER_VARYING 3\n"
+".emtcode TYPE_QUALIFIER_UNIFORM 4\n"
+".emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5\n"
+".emtcode TYPE_QUALIFIER_FIXEDINPUT 6\n"
+".emtcode TYPE_SPECIFIER_VOID 0\n"
+".emtcode TYPE_SPECIFIER_BOOL 1\n"
+".emtcode TYPE_SPECIFIER_BVEC2 2\n"
+".emtcode TYPE_SPECIFIER_BVEC3 3\n"
+".emtcode TYPE_SPECIFIER_BVEC4 4\n"
+".emtcode TYPE_SPECIFIER_INT 5\n"
+".emtcode TYPE_SPECIFIER_IVEC2 6\n"
+".emtcode TYPE_SPECIFIER_IVEC3 7\n"
+".emtcode TYPE_SPECIFIER_IVEC4 8\n"
+".emtcode TYPE_SPECIFIER_FLOAT 9\n"
+".emtcode TYPE_SPECIFIER_VEC2 10\n"
+".emtcode TYPE_SPECIFIER_VEC3 11\n"
+".emtcode TYPE_SPECIFIER_VEC4 12\n"
+".emtcode TYPE_SPECIFIER_MAT2 13\n"
+".emtcode TYPE_SPECIFIER_MAT3 14\n"
+".emtcode TYPE_SPECIFIER_MAT4 15\n"
+".emtcode TYPE_SPECIFIER_SAMPLER1D 16\n"
+".emtcode TYPE_SPECIFIER_SAMPLER2D 17\n"
+".emtcode TYPE_SPECIFIER_SAMPLER3D 18\n"
+".emtcode TYPE_SPECIFIER_SAMPLERCUBE 19\n"
+".emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20\n"
+".emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21\n"
+".emtcode TYPE_SPECIFIER_STRUCT 22\n"
+".emtcode TYPE_SPECIFIER_TYPENAME 23\n"
+".emtcode FIELD_NONE 0\n"
+".emtcode FIELD_NEXT 1\n"
+".emtcode FIELD_ARRAY 2\n"
+".emtcode OP_END 0\n"
+".emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1\n"
+".emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2\n"
+".emtcode OP_DECLARE 3\n"
+".emtcode OP_ASM 4\n"
+".emtcode OP_BREAK 5\n"
+".emtcode OP_CONTINUE 6\n"
+".emtcode OP_DISCARD 7\n"
+".emtcode OP_RETURN 8\n"
+".emtcode OP_EXPRESSION 9\n"
+".emtcode OP_IF 10\n"
+".emtcode OP_WHILE 11\n"
+".emtcode OP_DO 12\n"
+".emtcode OP_FOR 13\n"
+".emtcode OP_PUSH_VOID 14\n"
+".emtcode OP_PUSH_BOOL 15\n"
+".emtcode OP_PUSH_INT 16\n"
+".emtcode OP_PUSH_FLOAT 17\n"
+".emtcode OP_PUSH_IDENTIFIER 18\n"
+".emtcode OP_SEQUENCE 19\n"
+".emtcode OP_ASSIGN 20\n"
+".emtcode OP_ADDASSIGN 21\n"
+".emtcode OP_SUBASSIGN 22\n"
+".emtcode OP_MULASSIGN 23\n"
+".emtcode OP_DIVASSIGN 24\n"
+".emtcode OP_SELECT 31\n"
+".emtcode OP_LOGICALOR 32\n"
+".emtcode OP_LOGICALXOR 33\n"
+".emtcode OP_LOGICALAND 34\n"
+".emtcode OP_EQUAL 38\n"
+".emtcode OP_NOTEQUAL 39\n"
+".emtcode OP_LESS 40\n"
+".emtcode OP_GREATER 41\n"
+".emtcode OP_LESSEQUAL 42\n"
+".emtcode OP_GREATEREQUAL 43\n"
+".emtcode OP_ADD 46\n"
+".emtcode OP_SUBTRACT 47\n"
+".emtcode OP_MULTIPLY 48\n"
+".emtcode OP_DIVIDE 49\n"
+".emtcode OP_PREINCREMENT 51\n"
+".emtcode OP_PREDECREMENT 52\n"
+".emtcode OP_PLUS 53\n"
+".emtcode OP_MINUS 54\n"
+".emtcode OP_NOT 56\n"
+".emtcode OP_SUBSCRIPT 57\n"
+".emtcode OP_CALL 58\n"
+".emtcode OP_FIELD 59\n"
+".emtcode OP_POSTINCREMENT 60\n"
+".emtcode OP_POSTDECREMENT 61\n"
+".emtcode PARAM_QUALIFIER_IN 0\n"
+".emtcode PARAM_QUALIFIER_OUT 1\n"
+".emtcode PARAM_QUALIFIER_INOUT 2\n"
+".emtcode PARAMETER_NONE 0\n"
+".emtcode PARAMETER_NEXT 1\n"
+".emtcode PARAMETER_ARRAY_NOT_PRESENT 0\n"
+".emtcode PARAMETER_ARRAY_PRESENT 1\n"
+".errtext INVALID_EXTERNAL_DECLARATION \"error 2001: invalid external declaration\"\n"
+".errtext INVALID_OPERATOR_OVERRIDE \"error 2002: invalid operator override\"\n"
+".errtext LBRACE_EXPECTED \"error 2003: '{' expected but '$err_token$' found\"\n"
+".errtext LPAREN_EXPECTED \"error 2004: '(' expected but '$err_token$' found\"\n"
+".errtext RPAREN_EXPECTED \"error 2005: ')' expected but '$err_token$' found\"\n"
+".regbyte parsing_builtin 0\n"
+".regbyte shader_type 0\n"
+"variable_identifier\n"
+" identifier .emit OP_PUSH_IDENTIFIER;\n"
+"primary_expression\n"
+" floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;\n"
+"primary_expression_1\n"
+" lparen .and expression .and rparen;\n"
+"postfix_expression\n"
+" postfix_expression_1 .and .loop postfix_expression_2;\n"
+"postfix_expression_1\n"
+" function_call .or primary_expression;\n"
+"postfix_expression_2\n"
+" postfix_expression_3 .or postfix_expression_4 .or\n"
+" plusplus .emit OP_POSTINCREMENT .or\n"
+" minusminus .emit OP_POSTDECREMENT;\n"
+"postfix_expression_3\n"
+" lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;\n"
+"postfix_expression_4\n"
+" dot .and field_selection .emit OP_FIELD;\n"
+"integer_expression\n"
+" expression;\n"
+"function_call\n"
+" function_call_generic .emit OP_CALL .and .true .emit OP_END;\n"
+"function_call_generic\n"
+" function_call_generic_1 .or function_call_generic_2;\n"
+"function_call_generic_1\n"
+" function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;\n"
+"function_call_generic_2\n"
+" function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;\n"
+"function_call_header_no_parameters\n"
+" function_call_header .and function_call_header_no_parameters_1;\n"
+"function_call_header_no_parameters_1\n"
+" \"void\" .or .true;\n"
+"function_call_header_with_parameters\n"
+" function_call_header .and assignment_expression .and .true .emit OP_END .and\n"
+" .loop function_call_header_with_parameters_1;\n"
+"function_call_header_with_parameters_1\n"
+" comma .and assignment_expression .and .true .emit OP_END;\n"
+"function_call_header\n"
+" function_identifier .and lparen;\n"
+"function_identifier\n"
+" identifier;\n"
+"unary_expression\n"
+" postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n"
+" unary_expression_4 .or unary_expression_5;\n"
+"unary_expression_1\n"
+" plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;\n"
+"unary_expression_2\n"
+" minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;\n"
+"unary_expression_3\n"
+" plus .and unary_expression .and .true .emit OP_PLUS;\n"
+"unary_expression_4\n"
+" minus .and unary_expression .and .true .emit OP_MINUS;\n"
+"unary_expression_5\n"
+" bang .and unary_expression .and .true .emit OP_NOT;\n"
+"multiplicative_expression\n"
+" unary_expression .and .loop multiplicative_expression_1;\n"
+"multiplicative_expression_1\n"
+" multiplicative_expression_2 .or multiplicative_expression_3;\n"
+"multiplicative_expression_2\n"
+" star .and unary_expression .and .true .emit OP_MULTIPLY;\n"
+"multiplicative_expression_3\n"
+" slash .and unary_expression .and .true .emit OP_DIVIDE;\n"
+"additive_expression\n"
+" multiplicative_expression .and .loop additive_expression_1;\n"
+"additive_expression_1\n"
+" additive_expression_2 .or additive_expression_3;\n"
+"additive_expression_2\n"
+" plus .and multiplicative_expression .and .true .emit OP_ADD;\n"
+"additive_expression_3\n"
+" minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n"
+"shift_expression\n"
+" additive_expression;\n"
+"relational_expression\n"
+" shift_expression .and .loop relational_expression_1;\n"
+"relational_expression_1\n"
+" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n"
+" relational_expression_5;\n"
+"relational_expression_2\n"
+" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n"
+"relational_expression_3\n"
+" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n"
+"relational_expression_4\n"
+" less .and shift_expression .and .true .emit OP_LESS;\n"
+"relational_expression_5\n"
+" greater .and shift_expression .and .true .emit OP_GREATER;\n"
+"equality_expression\n"
+" relational_expression .and .loop equality_expression_1;\n"
+"equality_expression_1\n"
+" equality_expression_2 .or equality_expression_3;\n"
+"equality_expression_2\n"
+" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n"
+"equality_expression_3\n"
+" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n"
+"and_expression\n"
+" equality_expression;\n"
+"exclusive_or_expression\n"
+" and_expression;\n"
+"inclusive_or_expression\n"
+" exclusive_or_expression;\n"
+"logical_and_expression\n"
+" inclusive_or_expression .and .loop logical_and_expression_1;\n"
+"logical_and_expression_1\n"
+" ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;\n"
+"logical_xor_expression\n"
+" logical_and_expression .and .loop logical_xor_expression_1;\n"
+"logical_xor_expression_1\n"
+" caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;\n"
+"logical_or_expression\n"
+" logical_xor_expression .and .loop logical_or_expression_1;\n"
+"logical_or_expression_1\n"
+" barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;\n"
+"conditional_expression\n"
+" logical_or_expression .and .loop conditional_expression_1;\n"
+"conditional_expression_1\n"
+" question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;\n"
+"assignment_expression\n"
+" assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or\n"
+" assignment_expression_4 .or assignment_expression_5 .or conditional_expression;\n"
+"assignment_expression_1\n"
+" unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;\n"
+"assignment_expression_2\n"
+" unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;\n"
+"assignment_expression_3\n"
+" unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;\n"
+"assignment_expression_4\n"
+" unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;\n"
+"assignment_expression_5\n"
+" unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;\n"
+"expression\n"
+" assignment_expression .and .loop expression_1;\n"
+"expression_1\n"
+" comma .and assignment_expression .and .true .emit OP_SEQUENCE;\n"
+"constant_expression\n"
+" conditional_expression .and .true .emit OP_END;\n"
+"declaration\n"
+" declaration_1 .or declaration_2;\n"
+"declaration_1\n"
+" function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;\n"
+"declaration_2\n"
+" init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\n"
+"function_prototype\n"
+" function_prototype_1 .or function_prototype_2;\n"
+"function_prototype_1\n"
+" function_header .and \"void\" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n"
+"function_prototype_2\n"
+" function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n"
+"function_declarator\n"
+" function_header_with_parameters .or function_header;\n"
+"function_header_with_parameters\n"
+" function_header .and parameter_declaration .and .loop function_header_with_parameters_1;\n"
+"function_header_with_parameters_1\n"
+" comma .and parameter_declaration;\n"
+"function_header\n"
+" function_header_nospace .or function_header_space;\n"
+"function_header_space\n"
+" fully_specified_type_space .and space .and function_decl_identifier .and lparen;\n"
+"function_header_nospace\n"
+" fully_specified_type_nospace .and function_decl_identifier .and lparen;\n"
+"function_decl_identifier\n"
+" .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\n"
+" .if (parsing_builtin != 0) \"__constructor\" .emit FUNCTION_CONSTRUCTOR .or\n"
+" identifier .emit FUNCTION_ORDINARY;\n"
+"__operator\n"
+" \"__operator\" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;\n"
+"overriden_operator\n"
+" plusplus .emit OPERATOR_INCREMENT .or\n"
+" plusequals .emit OPERATOR_ADDASSIGN .or\n"
+" plus .emit OPERATOR_PLUS .or\n"
+" minusminus .emit OPERATOR_DECREMENT .or\n"
+" minusequals .emit OPERATOR_SUBASSIGN .or\n"
+" minus .emit OPERATOR_MINUS .or\n"
+" bang .emit OPERATOR_NOT .or\n"
+" starequals .emit OPERATOR_MULASSIGN .or\n"
+" star .emit OPERATOR_MULTIPLY .or\n"
+" slashequals .emit OPERATOR_DIVASSIGN .or\n"
+" slash .emit OPERATOR_DIVIDE .or\n"
+" lessequals .emit OPERATOR_LESSEQUAL .or\n"
+" \n"
+" \n"
+" less .emit OPERATOR_LESS .or\n"
+" greaterequals .emit OPERATOR_GREATEREQUAL .or\n"
+" \n"
+" \n"
+" greater .emit OPERATOR_GREATER .or\n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" \n"
+" caretcaret .emit OPERATOR_LOGICALXOR ;\n"
+"parameter_declarator\n"
+" parameter_declarator_nospace .or parameter_declarator_space;\n"
+"parameter_declarator_nospace\n"
+" type_specifier_nospace .and identifier .and parameter_declarator_1;\n"
+"parameter_declarator_space\n"
+" type_specifier_space .and space .and identifier .and parameter_declarator_1;\n"
+"parameter_declarator_1\n"
+" parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\n"
+" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n"
+"parameter_declarator_2\n"
+" lbracket .and constant_expression .and rbracket;\n"
+"parameter_declaration\n"
+" parameter_declaration_1 .emit PARAMETER_NEXT;\n"
+"parameter_declaration_1\n"
+" parameter_declaration_2 .or parameter_declaration_3;\n"
+"parameter_declaration_2\n"
+" type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;\n"
+"parameter_declaration_3\n"
+" parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\n"
+"parameter_declaration_4\n"
+" parameter_declarator .or parameter_type_specifier;\n"
+"parameter_qualifier\n"
+" parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\n"
+"parameter_qualifier_1\n"
+" parameter_qualifier_2 .and space;\n"
+"parameter_qualifier_2\n"
+" \"in\" .emit PARAM_QUALIFIER_IN .or\n"
+" \"out\" .emit PARAM_QUALIFIER_OUT .or\n"
+" \"inout\" .emit PARAM_QUALIFIER_INOUT;\n"
+"parameter_type_specifier\n"
+" parameter_type_specifier_1 .and .true .emit '\\0' .and parameter_type_specifier_2;\n"
+"parameter_type_specifier_1\n"
+" type_specifier_nospace .or type_specifier_space;\n"
+"parameter_type_specifier_2\n"
+" parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\n"
+" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n"
+"parameter_type_specifier_3\n"
+" lbracket .and constant_expression .and rbracket;\n"
+"init_declarator_list\n"
+" single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and\n"
+" .true .emit DECLARATOR_NONE;\n"
+"init_declarator_list_1\n"
+" comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;\n"
+"init_declarator_list_2\n"
+" init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;\n"
+"init_declarator_list_3\n"
+" equals .and initializer .emit VARIABLE_INITIALIZER;\n"
+"init_declarator_list_4\n"
+" lbracket .and init_declarator_list_5 .and rbracket;\n"
+"init_declarator_list_5\n"
+" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n"
+"single_declaration\n"
+" single_declaration_nospace .or single_declaration_space;\n"
+"single_declaration_space\n"
+" fully_specified_type_space .and single_declaration_space_1;\n"
+"single_declaration_nospace\n"
+" fully_specified_type_nospace .and single_declaration_nospace_1;\n"
+"single_declaration_space_1\n"
+" single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n"
+"single_declaration_nospace_1\n"
+" single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n"
+"single_declaration_space_2\n"
+" space .and identifier .and single_declaration_3;\n"
+"single_declaration_nospace_2\n"
+" identifier .and single_declaration_3;\n"
+"single_declaration_3\n"
+" single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\n"
+"single_declaration_4\n"
+" equals .and initializer .emit VARIABLE_INITIALIZER;\n"
+"single_declaration_5\n"
+" lbracket .and single_declaration_6 .and rbracket;\n"
+"single_declaration_6\n"
+" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n"
+"fully_specified_type_space\n"
+" fully_specified_type_1 .and type_specifier_space;\n"
+"fully_specified_type_nospace\n"
+" fully_specified_type_1 .and type_specifier_nospace;\n"
+"fully_specified_type_1\n"
+" fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;\n"
+"fully_specified_type_2\n"
+" type_qualifier .and space;\n"
+"type_qualifier\n"
+" \"const\" .emit TYPE_QUALIFIER_CONST .or\n"
+" .if (shader_type == 2) \"attribute\" .emit TYPE_QUALIFIER_ATTRIBUTE .or\n"
+" \"varying\" .emit TYPE_QUALIFIER_VARYING .or\n"
+" \"uniform\" .emit TYPE_QUALIFIER_UNIFORM .or\n"
+" .if (parsing_builtin != 0) \"__fixed_output\" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\n"
+" .if (parsing_builtin != 0) \"__fixed_input\" .emit TYPE_QUALIFIER_FIXEDINPUT;\n"
+"type_specifier_space\n"
+" \"void\" .emit TYPE_SPECIFIER_VOID .or\n"
+" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n"
+" \"int\" .emit TYPE_SPECIFIER_INT .or\n"
+" \"bool\" .emit TYPE_SPECIFIER_BOOL .or\n"
+" \"vec2\" .emit TYPE_SPECIFIER_VEC2 .or\n"
+" \"vec3\" .emit TYPE_SPECIFIER_VEC3 .or\n"
+" \"vec4\" .emit TYPE_SPECIFIER_VEC4 .or\n"
+" \"bvec2\" .emit TYPE_SPECIFIER_BVEC2 .or\n"
+" \"bvec3\" .emit TYPE_SPECIFIER_BVEC3 .or\n"
+" \"bvec4\" .emit TYPE_SPECIFIER_BVEC4 .or\n"
+" \"ivec2\" .emit TYPE_SPECIFIER_IVEC2 .or\n"
+" \"ivec3\" .emit TYPE_SPECIFIER_IVEC3 .or\n"
+" \"ivec4\" .emit TYPE_SPECIFIER_IVEC4 .or\n"
+" \"mat2\" .emit TYPE_SPECIFIER_MAT2 .or\n"
+" \"mat3\" .emit TYPE_SPECIFIER_MAT3 .or\n"
+" \"mat4\" .emit TYPE_SPECIFIER_MAT4 .or\n"
+" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n"
+" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n"
+" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n"
+" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n"
+" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n"
+" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n"
+" type_name .emit TYPE_SPECIFIER_TYPENAME;\n"
+"type_specifier_nospace\n"
+" struct_specifier .emit TYPE_SPECIFIER_STRUCT;\n"
+"struct_specifier\n"
+" \"struct\" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\n"
+" struct_declaration_list .and rbrace .emit FIELD_NONE;\n"
+"struct_specifier_1\n"
+" struct_specifier_2 .or .true .emit '\\0';\n"
+"struct_specifier_2\n"
+" space .and identifier;\n"
+"struct_declaration_list\n"
+" struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\n"
+"struct_declaration\n"
+" struct_declaration_nospace .or struct_declaration_space;\n"
+"struct_declaration_space\n"
+" type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n"
+"struct_declaration_nospace\n"
+" type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n"
+"struct_declarator_list\n"
+" struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\n"
+"struct_declarator_list_1\n"
+" comma .and struct_declarator;\n"
+"struct_declarator\n"
+" identifier .and struct_declarator_1;\n"
+"struct_declarator_1\n"
+" struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;\n"
+"struct_declarator_2\n"
+" lbracket .and constant_expression .and rbracket;\n"
+"initializer\n"
+" assignment_expression .and .true .emit OP_END;\n"
+"declaration_statement\n"
+" declaration;\n"
+"statement\n"
+" compound_statement .or simple_statement;\n"
+"statement_space\n"
+" compound_statement .or statement_space_1;\n"
+"statement_space_1\n"
+" space .and simple_statement;\n"
+"simple_statement\n"
+" .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\n"
+" selection_statement .or\n"
+" iteration_statement .or\n"
+" jump_statement .or\n"
+" expression_statement .emit OP_EXPRESSION .or\n"
+" declaration_statement .emit OP_DECLARE;\n"
+"compound_statement\n"
+" compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;\n"
+"compound_statement_1\n"
+" compound_statement_2 .or compound_statement_3;\n"
+"compound_statement_2\n"
+" lbrace .and rbrace;\n"
+"compound_statement_3\n"
+" lbrace .and statement_list .and rbrace;\n"
+"statement_no_new_scope\n"
+" compound_statement_no_new_scope .or simple_statement;\n"
+"compound_statement_no_new_scope\n"
+" compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\n"
+"compound_statement_no_new_scope_1\n"
+" compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;\n"
+"compound_statement_no_new_scope_2\n"
+" lbrace .and rbrace;\n"
+"compound_statement_no_new_scope_3\n"
+" lbrace .and statement_list .and rbrace;\n"
+"statement_list\n"
+" statement .and .loop statement;\n"
+"expression_statement\n"
+" expression_statement_1 .or expression_statement_2;\n"
+"expression_statement_1\n"
+" semicolon .emit OP_PUSH_VOID .emit OP_END;\n"
+"expression_statement_2\n"
+" expression .and semicolon .emit OP_END;\n"
+"selection_statement\n"
+" \"if\" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and\n"
+" rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;\n"
+"selection_rest_statement\n"
+" statement .and selection_rest_statement_1;\n"
+"selection_rest_statement_1\n"
+" selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\n"
+"selection_rest_statement_2\n"
+" \"else\" .and optional_space .and statement;\n"
+"condition\n"
+" condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\n"
+" condition_3 .emit OP_EXPRESSION;\n"
+"condition_1\n"
+" condition_1_nospace .or condition_1_space;\n"
+"condition_1_nospace\n"
+" fully_specified_type_nospace .and condition_2;\n"
+"condition_1_space\n"
+" fully_specified_type_space .and space .and condition_2;\n"
+"condition_2\n"
+" identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and\n"
+" initializer .and .true .emit DECLARATOR_NONE;\n"
+"condition_3\n"
+" expression .and .true .emit OP_END;\n"
+"iteration_statement\n"
+" iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\n"
+"iteration_statement_1\n"
+" \"while\" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\n"
+" rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\n"
+"iteration_statement_2\n"
+" \"do\" .emit OP_DO .and statement_space .and \"while\" .and lparen .error LPAREN_EXPECTED .and\n"
+" expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\n"
+"iteration_statement_3\n"
+" \"for\" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\n"
+" for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\n"
+"for_init_statement\n"
+" expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;\n"
+"conditionopt\n"
+" condition .or\n"
+" .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\\0' .emit OP_END;\n"
+"for_rest_statement\n"
+" conditionopt .and semicolon .and for_rest_statement_1;\n"
+"for_rest_statement_1\n"
+" for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;\n"
+"for_rest_statement_2\n"
+" expression .and .true .emit OP_END;\n"
+"jump_statement\n"
+" jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or\n"
+" .if (shader_type == 1) jump_statement_5;\n"
+"jump_statement_1\n"
+" \"continue\" .and semicolon .emit OP_CONTINUE;\n"
+"jump_statement_2\n"
+" \"break\" .and semicolon .emit OP_BREAK;\n"
+"jump_statement_3\n"
+" \"return\" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;\n"
+"jump_statement_4\n"
+" \"return\" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\n"
+"jump_statement_5\n"
+" \"discard\" .and semicolon .emit OP_DISCARD;\n"
+"__asm_statement\n"
+" \"__asm\" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\n"
+"asm_arguments\n"
+" asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\n"
+"asm_arguments_1\n"
+" comma .and asm_argument .and .true .emit OP_END;\n"
+"asm_argument\n"
+" variable_identifier .or floatconstant;\n"
+"translation_unit\n"
+" optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n"
+" .loop external_declaration .and optional_space .and\n"
+" '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n"
+"external_declaration\n"
+" function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n"
+" declaration .emit EXTERNAL_DECLARATION;\n"
+"function_definition\n"
+" function_prototype .and compound_statement_no_new_scope;\n"
+"digit_oct\n"
+" '0'-'7';\n"
+"digit_dec\n"
+" '0'-'9';\n"
+"digit_hex\n"
+" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n"
+"id_character_first\n"
+" 'a'-'z' .or 'A'-'Z' .or '_';\n"
+"id_character_next\n"
+" id_character_first .or digit_dec;\n"
+"identifier\n"
+" id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\\0';\n"
+"float\n"
+" float_1 .or float_2;\n"
+"float_1\n"
+" float_fractional_constant .and float_optional_exponent_part;\n"
+"float_2\n"
+" float_digit_sequence .and .true .emit '\\0' .and float_exponent_part;\n"
+"float_fractional_constant\n"
+" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n"
+"float_fractional_constant_1\n"
+" float_digit_sequence .and '.' .and float_digit_sequence;\n"
+"float_fractional_constant_2\n"
+" float_digit_sequence .and '.' .and .true .emit '\\0';\n"
+"float_fractional_constant_3\n"
+" '.' .emit '\\0' .and float_digit_sequence;\n"
+"float_optional_exponent_part\n"
+" float_exponent_part .or .true .emit '\\0';\n"
+"float_digit_sequence\n"
+" digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n"
+"float_exponent_part\n"
+" float_exponent_part_1 .or float_exponent_part_2;\n"
+"float_exponent_part_1\n"
+" 'e' .and float_optional_sign .and float_digit_sequence;\n"
+"float_exponent_part_2\n"
+" 'E' .and float_optional_sign .and float_digit_sequence;\n"
+"float_optional_sign\n"
+" float_sign .or .true;\n"
+"float_sign\n"
+" '+' .or '-' .emit '-';\n"
+"integer\n"
+" integer_hex .or integer_oct .or integer_dec;\n"
+"integer_hex\n"
+" '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and\n"
+" .true .emit '\\0';\n"
+"integer_hex_1\n"
+" 'x' .or 'X';\n"
+"integer_oct\n"
+" '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\\0';\n"
+"integer_dec\n"
+" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n"
+"boolean\n"
+" \"true\" .emit 2 .emit '1' .emit '\\0' .or\n"
+" \"false\" .emit 2 .emit '0' .emit '\\0';\n"
+"type_name\n"
+" identifier;\n"
+"field_selection\n"
+" identifier;\n"
+"floatconstant\n"
+" float .emit OP_PUSH_FLOAT;\n"
+"intconstant\n"
+" integer .emit OP_PUSH_INT;\n"
+"boolconstant\n"
+" boolean .emit OP_PUSH_BOOL;\n"
+"optional_space\n"
+" .loop single_space;\n"
+"space\n"
+" single_space .and .loop single_space;\n"
+"single_space\n"
+" white_char .or c_style_comment_block .or cpp_style_comment_block;\n"
+"white_char\n"
+" ' ' .or '\\t' .or new_line .or '\\v' .or '\\f';\n"
+"new_line\n"
+" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"
+"cr_lf\n"
+" '\\r' .and '\\n';\n"
+"lf_cr\n"
+" '\\n' .and '\\r';\n"
+"c_style_comment_block\n"
+" '/' .and '*' .and c_style_comment_rest;\n"
+"c_style_comment_rest\n"
+" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"
+"c_style_comment_rest_1\n"
+" c_style_comment_end .or c_style_comment_rest_2;\n"
+"c_style_comment_rest_2\n"
+" '*' .and c_style_comment_rest;\n"
+"c_style_comment_char_no_star\n"
+" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"
+"c_style_comment_end\n"
+" '*' .and '/';\n"
+"cpp_style_comment_block\n"
+" '/' .and '/' .and cpp_style_comment_block_1;\n"
+"cpp_style_comment_block_1\n"
+" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"
+"cpp_style_comment_block_2\n"
+" .loop cpp_style_comment_char .and new_line;\n"
+"cpp_style_comment_block_3\n"
+" .loop cpp_style_comment_char;\n"
+"cpp_style_comment_char\n"
+" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
+"ampersandampersand\n"
+" optional_space .and '&' .and '&' .and optional_space;\n"
+"barbar\n"
+" optional_space .and '|' .and '|' .and optional_space;\n"
+"bang\n"
+" optional_space .and '!' .and optional_space;\n"
+"bangequals\n"
+" optional_space .and '!' .and '=' .and optional_space;\n"
+"caretcaret\n"
+" optional_space .and '^' .and '^' .and optional_space;\n"
+"colon\n"
+" optional_space .and ':' .and optional_space;\n"
+"comma\n"
+" optional_space .and ',' .and optional_space;\n"
+"dot\n"
+" optional_space .and '.' .and optional_space;\n"
+"equals\n"
+" optional_space .and '=' .and optional_space;\n"
+"equalsequals\n"
+" optional_space .and '=' .and '=' .and optional_space;\n"
+"greater\n"
+" optional_space .and '>' .and optional_space;\n"
+"greaterequals\n"
+" optional_space .and '>' .and '=' .and optional_space;\n"
+"lbrace\n"
+" optional_space .and '{' .and optional_space;\n"
+"lbracket\n"
+" optional_space .and '[' .and optional_space;\n"
+"less\n"
+" optional_space .and '<' .and optional_space;\n"
+"lessequals\n"
+" optional_space .and '<' .and '=' .and optional_space;\n"
+"lparen\n"
+" optional_space .and '(' .and optional_space;\n"
+"minus\n"
+" optional_space .and '-' .and optional_space;\n"
+"minusequals\n"
+" optional_space .and '-' .and '=' .and optional_space;\n"
+"minusminus\n"
+" optional_space .and '-' .and '-' .and optional_space;\n"
+"plus\n"
+" optional_space .and '+' .and optional_space;\n"
+"plusequals\n"
+" optional_space .and '+' .and '=' .and optional_space;\n"
+"plusplus\n"
+" optional_space .and '+' .and '+' .and optional_space;\n"
+"question\n"
+" optional_space .and '?' .and optional_space;\n"
+"rbrace\n"
+" optional_space .and '}' .and optional_space;\n"
+"rbracket\n"
+" optional_space .and ']' .and optional_space;\n"
+"rparen\n"
+" optional_space .and ')' .and optional_space;\n"
+"semicolon\n"
+" optional_space .and ';' .and optional_space;\n"
+"slash\n"
+" optional_space .and '/' .and optional_space;\n"
+"slashequals\n"
+" optional_space .and '/' .and '=' .and optional_space;\n"
+"star\n"
+" optional_space .and '*' .and optional_space;\n"
+"starequals\n"
+" optional_space .and '*' .and '=' .and optional_space;\n"
+".string string_lexer;\n"
+"string_lexer\n"
+" lex_first_identifier_character .and .loop lex_next_identifier_character;\n"
+"lex_first_identifier_character\n"
+" 'a'-'z' .or 'A'-'Z' .or '_';\n"
+"lex_next_identifier_character\n"
+" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n"
+"err_token\n"
+" '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or\n"
+" '-' .or '+' .or '=' .or '|' .or '\\\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '\"' .or\n"
+" '\\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\n"
+"err_identifier\n"
+" id_character_first .and .loop id_character_next;\n"
""
\ No newline at end of file
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.3\r
- *\r
- * Copyright (C) 2005 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_version.syn\r
- * slang #version directive syntax\r
- * \author Michal Krol\r
- */\r
-\r
-.syntax version_directive;\r
-\r
-version_directive\r
- version_directive_1 .and .loop version_directive_2;\r
-version_directive_1\r
- prior_optional_spaces .and optional_version_directive .and .true .emit $;\r
-version_directive_2\r
- prior_optional_spaces .and version_directive_body .and .true .emit $;\r
-\r
-optional_version_directive\r
- version_directive_body .or .true .emit 10 .emit 1;\r
-\r
-version_directive_body\r
- '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and\r
- new_line;\r
-\r
-version_number\r
- version_number_110;\r
-\r
-version_number_110\r
- leading_zeroes .and "110" .emit 10 .emit 1;\r
-\r
-leading_zeroes\r
- .loop zero;\r
-\r
-zero\r
- '0';\r
-\r
-space\r
- single_space .and .loop single_space;\r
-\r
-optional_space\r
- .loop single_space;\r
-\r
-single_space\r
- ' ' .or '\t';\r
-\r
-prior_optional_spaces\r
- .loop prior_space;\r
-\r
-prior_space\r
- c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\r
-\r
-c_style_comment_block\r
- '/' .and '*' .and c_style_comment_rest;\r
-\r
-c_style_comment_rest\r
- .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\r
-c_style_comment_rest_1\r
- c_style_comment_end .or c_style_comment_rest_2;\r
-c_style_comment_rest_2\r
- '*' .and c_style_comment_rest;\r
-\r
-c_style_comment_char_no_star\r
- '\x2B'-'\xFF' .or '\x01'-'\x29';\r
-\r
-c_style_comment_end\r
- '*' .and '/';\r
-\r
-cpp_style_comment_block\r
- '/' .and '/' .and cpp_style_comment_block_1;\r
-cpp_style_comment_block_1\r
- cpp_style_comment_block_2 .or cpp_style_comment_block_3;\r
-cpp_style_comment_block_2\r
- .loop cpp_style_comment_char .and new_line;\r
-cpp_style_comment_block_3\r
- .loop cpp_style_comment_char;\r
-\r
-cpp_style_comment_char\r
- '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';\r
-\r
-new_line\r
- cr_lf .or lf_cr .or '\n' .or '\r';\r
-\r
-cr_lf\r
- '\r' .and '\n';\r
-\r
-lf_cr\r
- '\n' .and '\r';\r
-\r
-.string __string_filter;\r
-\r
-__string_filter\r
- .loop __identifier_char;\r
-\r
-__identifier_char\r
- 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.3
+ *
+ * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_version.syn
+ * slang #version directive syntax
+ * \author Michal Krol
+ */
+
+.syntax version_directive;
+
+version_directive
+ version_directive_1 .and .loop version_directive_2;
+version_directive_1
+ prior_optional_spaces .and optional_version_directive .and .true .emit $;
+version_directive_2
+ prior_optional_spaces .and version_directive_body .and .true .emit $;
+
+optional_version_directive
+ version_directive_body .or .true .emit 10 .emit 1;
+
+version_directive_body
+ '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and
+ new_line;
+
+version_number
+ version_number_110;
+
+version_number_110
+ leading_zeroes .and "110" .emit 10 .emit 1;
+
+leading_zeroes
+ .loop zero;
+
+zero
+ '0';
+
+space
+ single_space .and .loop single_space;
+
+optional_space
+ .loop single_space;
+
+single_space
+ ' ' .or '\t';
+
+prior_optional_spaces
+ .loop prior_space;
+
+prior_space
+ c_style_comment_block .or cpp_style_comment_block .or space .or new_line;
+
+c_style_comment_block
+ '/' .and '*' .and c_style_comment_rest;
+
+c_style_comment_rest
+ .loop c_style_comment_char_no_star .and c_style_comment_rest_1;
+c_style_comment_rest_1
+ c_style_comment_end .or c_style_comment_rest_2;
+c_style_comment_rest_2
+ '*' .and c_style_comment_rest;
+
+c_style_comment_char_no_star
+ '\x2B'-'\xFF' .or '\x01'-'\x29';
+
+c_style_comment_end
+ '*' .and '/';
+
+cpp_style_comment_block
+ '/' .and '/' .and cpp_style_comment_block_1;
+cpp_style_comment_block_1
+ cpp_style_comment_block_2 .or cpp_style_comment_block_3;
+cpp_style_comment_block_2
+ .loop cpp_style_comment_char .and new_line;
+cpp_style_comment_block_3
+ .loop cpp_style_comment_char;
+
+cpp_style_comment_char
+ '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';
+
+new_line
+ cr_lf .or lf_cr .or '\n' .or '\r';
+
+cr_lf
+ '\r' .and '\n';
+
+lf_cr
+ '\n' .and '\r';
+
+.string __string_filter;
+
+__string_filter
+ .loop __identifier_char;
+
+__identifier_char
+ 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';
+
-".syntax version_directive;\n"\r
-"version_directive\n"\r
-" version_directive_1 .and .loop version_directive_2;\n"\r
-"version_directive_1\n"\r
-" prior_optional_spaces .and optional_version_directive .and .true .emit $;\n"\r
-"version_directive_2\n"\r
-" prior_optional_spaces .and version_directive_body .and .true .emit $;\n"\r
-"optional_version_directive\n"\r
-" version_directive_body .or .true .emit 10 .emit 1;\n"\r
-"version_directive_body\n"\r
-" '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n"\r
-" new_line;\n"\r
-"version_number\n"\r
-" version_number_110;\n"\r
-"version_number_110\n"\r
-" leading_zeroes .and \"110\" .emit 10 .emit 1;\n"\r
-"leading_zeroes\n"\r
-" .loop zero;\n"\r
-"zero\n"\r
-" '0';\n"\r
-"space\n"\r
-" single_space .and .loop single_space;\n"\r
-"optional_space\n"\r
-" .loop single_space;\n"\r
-"single_space\n"\r
-" ' ' .or '\\t';\n"\r
-"prior_optional_spaces\n"\r
-" .loop prior_space;\n"\r
-"prior_space\n"\r
-" c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n"\r
-"c_style_comment_block\n"\r
-" '/' .and '*' .and c_style_comment_rest;\n"\r
-"c_style_comment_rest\n"\r
-" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"\r
-"c_style_comment_rest_1\n"\r
-" c_style_comment_end .or c_style_comment_rest_2;\n"\r
-"c_style_comment_rest_2\n"\r
-" '*' .and c_style_comment_rest;\n"\r
-"c_style_comment_char_no_star\n"\r
-" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"\r
-"c_style_comment_end\n"\r
-" '*' .and '/';\n"\r
-"cpp_style_comment_block\n"\r
-" '/' .and '/' .and cpp_style_comment_block_1;\n"\r
-"cpp_style_comment_block_1\n"\r
-" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"\r
-"cpp_style_comment_block_2\n"\r
-" .loop cpp_style_comment_char .and new_line;\n"\r
-"cpp_style_comment_block_3\n"\r
-" .loop cpp_style_comment_char;\n"\r
-"cpp_style_comment_char\n"\r
-" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"\r
-"new_line\n"\r
-" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"\r
-"cr_lf\n"\r
-" '\\r' .and '\\n';\n"\r
-"lf_cr\n"\r
-" '\\n' .and '\\r';\n"\r
-".string __string_filter;\n"\r
-"__string_filter\n"\r
-" .loop __identifier_char;\n"\r
-"__identifier_char\n"\r
-" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n"\r
-""\r
+".syntax version_directive;\n"
+"version_directive\n"
+" version_directive_1 .and .loop version_directive_2;\n"
+"version_directive_1\n"
+" prior_optional_spaces .and optional_version_directive .and .true .emit $;\n"
+"version_directive_2\n"
+" prior_optional_spaces .and version_directive_body .and .true .emit $;\n"
+"optional_version_directive\n"
+" version_directive_body .or .true .emit 10 .emit 1;\n"
+"version_directive_body\n"
+" '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n"
+" new_line;\n"
+"version_number\n"
+" version_number_110;\n"
+"version_number_110\n"
+" leading_zeroes .and \"110\" .emit 10 .emit 1;\n"
+"leading_zeroes\n"
+" .loop zero;\n"
+"zero\n"
+" '0';\n"
+"space\n"
+" single_space .and .loop single_space;\n"
+"optional_space\n"
+" .loop single_space;\n"
+"single_space\n"
+" ' ' .or '\\t';\n"
+"prior_optional_spaces\n"
+" .loop prior_space;\n"
+"prior_space\n"
+" c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n"
+"c_style_comment_block\n"
+" '/' .and '*' .and c_style_comment_rest;\n"
+"c_style_comment_rest\n"
+" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"
+"c_style_comment_rest_1\n"
+" c_style_comment_end .or c_style_comment_rest_2;\n"
+"c_style_comment_rest_2\n"
+" '*' .and c_style_comment_rest;\n"
+"c_style_comment_char_no_star\n"
+" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"
+"c_style_comment_end\n"
+" '*' .and '/';\n"
+"cpp_style_comment_block\n"
+" '/' .and '/' .and cpp_style_comment_block_1;\n"
+"cpp_style_comment_block_1\n"
+" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"
+"cpp_style_comment_block_2\n"
+" .loop cpp_style_comment_char .and new_line;\n"
+"cpp_style_comment_block_3\n"
+" .loop cpp_style_comment_char;\n"
+"cpp_style_comment_char\n"
+" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
+"new_line\n"
+" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"
+"cr_lf\n"
+" '\\r' .and '\\n';\n"
+"lf_cr\n"
+" '\\n' .and '\\r';\n"
+".string __string_filter;\n"
+"__string_filter\n"
+" .loop __identifier_char;\n"
+"__identifier_char\n"
+" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n"
+""
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
//
// From Shader Spec, ver. 1.10, rev. 59
//
// Geometric Functions
//
-\r
+
vec4 ftransform () {
return gl_ModelViewProjectionMatrix * gl_Vertex;
}
// 8.7 Texture Lookup Functions
//
-vec4 texture1DLod (sampler1D sampler, float coord, float lod) {\r
- vec4 texel;\r
- __asm vec4_tex1d texel, sampler, coord, lod;\r
+vec4 texture1DLod (sampler1D sampler, float coord, float lod) {
+ vec4 texel;
+ __asm vec4_tex1d texel, sampler, coord, lod;
return texel;
-}\r
+}
vec4 texture1DProjLod (sampler1D sampler, vec2 coord, float lod) {
return texture1DLod (sampler, coord.s / coord.t, lod);
-}\r
+}
vec4 texture1DProjLod (sampler1D sampler, vec4 coord, float lod) {
return texture1DLod (sampler, coord.s / coord.q, lod);
}
-vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod) {\r
- vec4 texel;\r
- __asm vec4_tex2d texel, sampler, coord, lod;\r
+vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod) {
+ vec4 texel;
+ __asm vec4_tex2d texel, sampler, coord, lod;
return texel;
-}\r
+}
-vec4 texture2DProjLod (sampler2D sampler, vec3 coord, float lod) {\r
+vec4 texture2DProjLod (sampler2D sampler, vec3 coord, float lod) {
return texture2DLod (sampler, vec2 (coord.s / coord.p, coord.t / coord.p), lod);
-}\r
+}
-vec4 texture2DProjLod (sampler2D sampler, vec4 coord, float lod) {\r
+vec4 texture2DProjLod (sampler2D sampler, vec4 coord, float lod) {
return texture2DLod (sampler, vec2 (coord.s / coord.q, coord.t / coord.q), lod);
}
-vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod) {\r
- vec4 texel;\r
- __asm vec4_tex3d texel, sampler, coord, lod;\r
+vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_tex3d texel, sampler, coord, lod;
return texel;
}
-vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod) {\r
+vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod) {
return texture3DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), lod);
}
-vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod) {\r
- vec4 texel;\r
- __asm vec4_texcube texel, sampler, coord, lod;\r
+vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_texcube texel, sampler, coord, lod;
return texel;
}
-vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod) {\r
- vec4 texel;\r
- __asm vec4_shad1d texel, sampler, coord, lod;\r
+vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_shad1d texel, sampler, coord, lod;
return texel;
}
-vec4 shadow1DProjLod (sampler1DShadow sampler, vec4 coord, float lod) {\r
- return shadow1DLod (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), lod);\r
-}\r
-\r
-vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod) {\r
- vec4 texel;\r
- __asm vec4_shad2d texel, sampler, coord, lod;\r
+vec4 shadow1DProjLod (sampler1DShadow sampler, vec4 coord, float lod) {
+ return shadow1DLod (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), lod);
+}
+
+vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_shad2d texel, sampler, coord, lod;
return texel;
-}\r
+}
-vec4 shadow2DProjLod (sampler2DShadow sampler, vec4 coord, float lod) {\r
+vec4 shadow2DProjLod (sampler2DShadow sampler, vec4 coord, float lod) {
return shadow2DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), lod);
}
-\r
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\r
-/* slang_vertex_builtin.gc */\r
-\r
-3,2,2,5,12,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,5,9,1,103,108,95,80,111,105,110,\r
-116,83,105,122,101,0,0,0,2,2,5,12,1,103,108,95,67,108,105,112,86,101,114,116,101,120,0,0,0,2,2,2,\r
-12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,2,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,\r
-111,108,111,114,0,0,0,2,2,2,11,1,103,108,95,78,111,114,109,97,108,0,0,0,2,2,2,12,1,103,108,95,86,\r
-101,114,116,101,120,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,\r
-48,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,2,12,\r
-1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,2,12,1,103,108,95,77,\r
-117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,\r
-101,120,67,111,111,114,100,52,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,\r
-114,100,53,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,54,0,0,0,2,\r
-2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,55,0,0,0,2,2,2,9,1,103,108,95,\r
-70,111,103,67,111,111,114,100,0,0,0,2,2,3,12,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,\r
-0,0,2,2,3,12,1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,70,114,111,\r
-110,116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,66,97,99,\r
-107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,\r
-111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,\r
-0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,12,0,102,116,114,97,\r
-110,115,102,111,114,109,0,0,1,8,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,\r
-99,116,105,111,110,77,97,116,114,105,120,0,18,103,108,95,86,101,114,116,101,120,0,48,0,0,1,0,12,0,\r
-116,101,120,116,117,114,101,49,68,76,111,100,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,\r
-111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,\r
-52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,\r
-111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,\r
-114,101,49,68,80,114,111,106,76,111,100,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,\r
-111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,76,111,100,0,18,\r
-115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,116,0,\r
-49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,\r
-0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,\r
-0,1,8,58,116,101,120,116,117,114,101,49,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,18,99,\r
-111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,\r
-116,101,120,116,117,114,101,50,68,76,111,100,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,\r
-111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,\r
-52,95,116,101,120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,\r
-111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,\r
-114,101,50,68,80,114,111,106,76,111,100,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,\r
-111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,76,111,100,0,18,\r
-115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,\r
-114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,\r
-18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,\r
-0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,\r
-8,58,116,101,120,116,117,114,101,50,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,\r
-99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,\r
-100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,\r
-120,116,117,114,101,51,68,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,\r
-114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,\r
-116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,\r
-114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,\r
-101,51,68,80,114,111,106,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,\r
-114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,76,111,100,0,18,115,\r
-97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,\r
-100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,\r
-111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,\r
-12,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,0,0,19,115,97,109,112,108,101,114,0,\r
-0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,\r
-4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,\r
-101,114,0,0,18,99,111,111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,\r
-115,104,97,100,111,119,49,68,76,111,100,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,\r
-111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,\r
-95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,\r
-111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,\r
-119,49,68,80,114,111,106,76,111,100,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,\r
-114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,100,111,119,49,68,76,111,100,0,18,115,97,\r
-109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,\r
-0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,\r
-49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,76,111,100,0,1,0,0,21,115,\r
-97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,\r
-116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,\r
-115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,\r
-108,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,0,0,21,115,97,109,\r
-112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,\r
-100,111,119,50,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,\r
-114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,\r
-111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,\r
-49,0,0,0,18,108,111,100,0,0,0,0,0,0\r
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_vertex_builtin.gc */
+
+3,2,2,5,12,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,5,9,1,103,108,95,80,111,105,110,
+116,83,105,122,101,0,0,0,2,2,5,12,1,103,108,95,67,108,105,112,86,101,114,116,101,120,0,0,0,2,2,2,
+12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,2,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,
+111,108,111,114,0,0,0,2,2,2,11,1,103,108,95,78,111,114,109,97,108,0,0,0,2,2,2,12,1,103,108,95,86,
+101,114,116,101,120,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,
+48,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,2,12,
+1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,2,12,1,103,108,95,77,
+117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,
+101,120,67,111,111,114,100,52,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,
+114,100,53,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,54,0,0,0,2,
+2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,55,0,0,0,2,2,2,9,1,103,108,95,
+70,111,103,67,111,111,114,100,0,0,0,2,2,3,12,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,
+0,0,2,2,3,12,1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,70,114,111,
+110,116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,66,97,99,
+107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,
+111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,
+0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,12,0,102,116,114,97,
+110,115,102,111,114,109,0,0,1,8,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,
+99,116,105,111,110,77,97,116,114,105,120,0,18,103,108,95,86,101,114,116,101,120,0,48,0,0,1,0,12,0,
+116,101,120,116,117,114,101,49,68,76,111,100,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,
+111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,
+52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
+111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,
+114,101,49,68,80,114,111,106,76,111,100,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,
+111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,76,111,100,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,116,0,
+49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,
+0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,
+0,1,8,58,116,101,120,116,117,114,101,49,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,18,99,
+111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,
+116,101,120,116,117,114,101,50,68,76,111,100,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,
+111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,
+52,95,116,101,120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
+111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,
+114,101,50,68,80,114,111,106,76,111,100,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,
+111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,76,111,100,0,18,
+115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,
+114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,
+18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,
+0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,
+8,58,116,101,120,116,117,114,101,50,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,
+99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,
+100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,
+120,116,117,114,101,51,68,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,
+114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,
+116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,
+114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,
+101,51,68,80,114,111,106,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,
+114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,76,111,100,0,18,115,
+97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,
+100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,
+111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,
+12,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,0,0,19,115,97,109,112,108,101,114,0,
+0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,
+4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,
+101,114,0,0,18,99,111,111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,
+115,104,97,100,111,119,49,68,76,111,100,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,
+111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,
+95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
+111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,
+119,49,68,80,114,111,106,76,111,100,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,
+114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,100,111,119,49,68,76,111,100,0,18,115,97,
+109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,
+0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,
+49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,76,111,100,0,1,0,0,21,115,
+97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,
+116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,
+108,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,0,0,21,115,97,109,
+112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,
+100,111,119,50,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,
+114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,
+111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,
+49,0,0,0,18,108,111,100,0,0,0,0,0,0
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_analyse.c\r
- * slang assembly code analysis\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_analyse.h"\r
-#include "slang_utility.h"\r
-\r
-GLboolean _slang_analyse_texture_usage (slang_program *prog)\r
-{\r
- GLuint i, count = 0;\r
-\r
- slang_texture_usages_dtr (&prog->texture_usage);\r
- slang_texture_usages_ctr (&prog->texture_usage);\r
-\r
- /*\r
- * We could do a full code analysis to find out which uniforms are actually used.\r
- * For now, we are very conservative and extract them from uniform binding table, which\r
- * in turn also do not come from code analysis.\r
- */\r
-\r
- for (i = 0; i < prog->uniforms.count; i++)\r
- {\r
- slang_uniform_binding *b = &prog->uniforms.table[i];\r
-\r
- if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && !slang_export_data_quant_struct (b->quant))\r
- {\r
- switch (slang_export_data_quant_type (b->quant))\r
- {\r
- case GL_SAMPLER_1D_ARB:\r
- case GL_SAMPLER_2D_ARB:\r
- case GL_SAMPLER_3D_ARB:\r
- case GL_SAMPLER_CUBE_ARB:\r
- case GL_SAMPLER_1D_SHADOW_ARB:\r
- case GL_SAMPLER_2D_SHADOW_ARB:\r
- count++;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- if (count == 0)\r
- return GL_TRUE;\r
- prog->texture_usage.table = (slang_texture_usage *) slang_alloc_malloc (\r
- count * sizeof (slang_texture_usage));\r
- if (prog->texture_usage.table == NULL)\r
- return GL_FALSE;\r
- prog->texture_usage.count = count;\r
-\r
- for (count = i = 0; i < prog->uniforms.count; i++)\r
- {\r
- slang_uniform_binding *b = &prog->uniforms.table[i];\r
-\r
- if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && !slang_export_data_quant_struct (b->quant))\r
- {\r
- switch (slang_export_data_quant_type (b->quant))\r
- {\r
- case GL_SAMPLER_1D_ARB:\r
- case GL_SAMPLER_2D_ARB:\r
- case GL_SAMPLER_3D_ARB:\r
- case GL_SAMPLER_CUBE_ARB:\r
- case GL_SAMPLER_1D_SHADOW_ARB:\r
- case GL_SAMPLER_2D_SHADOW_ARB:\r
- prog->texture_usage.table[count].quant = b->quant;\r
- prog->texture_usage.table[count].frag_address = b->address[SLANG_SHADER_FRAGMENT];\r
- count++;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_analyse.c
+ * slang assembly code analysis
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_analyse.h"
+#include "slang_utility.h"
+
+GLboolean _slang_analyse_texture_usage (slang_program *prog)
+{
+ GLuint i, count = 0;
+
+ slang_texture_usages_dtr (&prog->texture_usage);
+ slang_texture_usages_ctr (&prog->texture_usage);
+
+ /*
+ * We could do a full code analysis to find out which uniforms are actually used.
+ * For now, we are very conservative and extract them from uniform binding table, which
+ * in turn also do not come from code analysis.
+ */
+
+ for (i = 0; i < prog->uniforms.count; i++)
+ {
+ slang_uniform_binding *b = &prog->uniforms.table[i];
+
+ if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && !slang_export_data_quant_struct (b->quant))
+ {
+ switch (slang_export_data_quant_type (b->quant))
+ {
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ count++;
+ break;
+ }
+ }
+ }
+
+ if (count == 0)
+ return GL_TRUE;
+ prog->texture_usage.table = (slang_texture_usage *) slang_alloc_malloc (
+ count * sizeof (slang_texture_usage));
+ if (prog->texture_usage.table == NULL)
+ return GL_FALSE;
+ prog->texture_usage.count = count;
+
+ for (count = i = 0; i < prog->uniforms.count; i++)
+ {
+ slang_uniform_binding *b = &prog->uniforms.table[i];
+
+ if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && !slang_export_data_quant_struct (b->quant))
+ {
+ switch (slang_export_data_quant_type (b->quant))
+ {
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ prog->texture_usage.table[count].quant = b->quant;
+ prog->texture_usage.table[count].frag_address = b->address[SLANG_SHADER_FRAGMENT];
+ count++;
+ break;
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_ANALYSE_H\r
-#define SLANG_ANALYSE_H\r
-\r
-#include "slang_link.h"\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/*\r
- * Texture usage analysis is a bit more difficult than for fragment programs. While fragment\r
- * programs statically link to texture targets and texture units, shaders statically link\r
- * only to texture targets. The texture unit linkage is determined just before the execution\r
- * of a given primitive by reading active uniform samplers.\r
- *\r
- * This procedure retrieves a list of uniforms that reach texture sample instructions.\r
- */\r
-\r
-GLboolean _slang_analyse_texture_usage (slang_program *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_ANALYSE_H
+#define SLANG_ANALYSE_H
+
+#include "slang_link.h"
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Texture usage analysis is a bit more difficult than for fragment programs. While fragment
+ * programs statically link to texture targets and texture units, shaders statically link
+ * only to texture targets. The texture unit linkage is determined just before the execution
+ * of a given primitive by reading active uniform samplers.
+ *
+ * This procedure retrieves a list of uniforms that reach texture sample instructions.
+ */
+
+GLboolean _slang_analyse_texture_usage (slang_program *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_assemble.c\r
- * slang intermediate code assembler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_assemble.h"\r
-#include "slang_compile.h"\r
-#include "slang_storage.h"\r
-\r
-/* slang_assembly */\r
-\r
-static GLboolean slang_assembly_construct (slang_assembly *assem)\r
-{\r
- assem->type = slang_asm_none;\r
- return GL_TRUE;\r
-}\r
-\r
-static GLvoid slang_assembly_destruct (slang_assembly *assem)\r
-{\r
-}\r
-\r
-/* slang_assembly_file */\r
-\r
-GLboolean slang_assembly_file_construct (slang_assembly_file *file)\r
-{\r
- file->code = NULL;\r
- file->count = 0;\r
- file->capacity = 0;\r
- return GL_TRUE;\r
-}\r
-\r
-GLvoid slang_assembly_file_destruct (slang_assembly_file *file)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < file->count; i++)\r
- slang_assembly_destruct (&file->code[i]);\r
- slang_alloc_free (file->code);\r
-}\r
-\r
-static GLboolean push_new (slang_assembly_file *file)\r
-{\r
- if (file->count == file->capacity)\r
- {\r
- GLuint n;\r
-\r
- if (file->capacity == 0)\r
- n = 256;\r
- else\r
- n = file->capacity * 2;\r
- file->code = (slang_assembly *) slang_alloc_realloc (file->code,\r
- file->capacity * sizeof (slang_assembly), n * sizeof (slang_assembly));\r
- if (file->code == NULL)\r
- return GL_FALSE;\r
- file->capacity = n;\r
- }\r
- if (!slang_assembly_construct (&file->code[file->count]))\r
- return GL_FALSE;\r
- file->count++;\r
- return GL_TRUE;\r
-}\r
-\r
-static GLboolean push_gen (slang_assembly_file *file, slang_assembly_type type, GLfloat literal,\r
- GLuint label, GLuint size)\r
-{\r
- slang_assembly *assem;\r
-\r
- if (!push_new (file))\r
- return GL_FALSE;\r
- assem = &file->code[file->count - 1];\r
- assem->type = type;\r
- assem->literal = literal;\r
- assem->param[0] = label;\r
- assem->param[1] = size;\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean slang_assembly_file_push (slang_assembly_file *file, slang_assembly_type type)\r
-{\r
- return push_gen (file, type, (GLfloat) 0, 0, 0);\r
-}\r
-\r
-GLboolean slang_assembly_file_push_label (slang_assembly_file *file, slang_assembly_type type,\r
- GLuint label)\r
-{\r
- return push_gen (file, type, (GLfloat) 0, label, 0);\r
-}\r
-\r
-GLboolean slang_assembly_file_push_label2 (slang_assembly_file *file, slang_assembly_type type,\r
- GLuint label1, GLuint label2)\r
-{\r
- return push_gen (file, type, (GLfloat) 0, label1, label2);\r
-}\r
-\r
-GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_assembly_type type,\r
- GLfloat literal)\r
-{\r
- return push_gen (file, type, literal, 0, 0);\r
-}\r
-\r
-#define PUSH slang_assembly_file_push\r
-#define PLAB slang_assembly_file_push_label\r
-#define PLAB2 slang_assembly_file_push_label2\r
-#define PLIT slang_assembly_file_push_literal\r
-\r
-/* slang_assembly_file_restore_point */\r
-\r
-GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *file,\r
- slang_assembly_file_restore_point *point)\r
-{\r
- point->count = file->count;\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *file,\r
- slang_assembly_file_restore_point *point)\r
-{\r
- GLuint i;\r
-\r
- for (i = point->count; i < file->count; i++)\r
- slang_assembly_destruct (&file->code[i]);\r
- file->count = point->count;\r
- return GL_TRUE;\r
-}\r
-\r
-/* utility functions */\r
-\r
-static GLboolean sizeof_variable (slang_assemble_ctx *A, slang_type_specifier *spec,\r
- slang_type_qualifier qual, GLuint array_len, GLuint *size)\r
-{\r
- slang_storage_aggregate agg;\r
-\r
- /* calculate the size of the variable's aggregate */\r
- if (!slang_storage_aggregate_construct (&agg))\r
- return GL_FALSE;\r
- if (!_slang_aggregate_variable (&agg, spec, array_len, A->space.funcs, A->space.structs,\r
- A->space.vars, A->mach, A->file, A->atoms))\r
- {\r
- slang_storage_aggregate_destruct (&agg);\r
- return GL_FALSE;\r
- }\r
- *size += _slang_sizeof_aggregate (&agg);\r
- slang_storage_aggregate_destruct (&agg);\r
-\r
- /* for reference variables consider the additional address overhead */\r
- if (qual == slang_qual_out || qual == slang_qual_inout)\r
- *size += 4;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-static GLboolean sizeof_variable2 (slang_assemble_ctx *A, slang_variable *var, GLuint *size)\r
-{\r
- var->address = *size;\r
- if (var->type.qualifier == slang_qual_out || var->type.qualifier == slang_qual_inout)\r
- var->address += 4;\r
- return sizeof_variable (A, &var->type.specifier, var->type.qualifier, var->array_len, size);\r
-}\r
-\r
-static GLboolean sizeof_variables (slang_assemble_ctx *A, slang_variable_scope *vars, GLuint start,\r
- GLuint stop, GLuint *size)\r
-{\r
- GLuint i;\r
-\r
- for (i = start; i < stop; i++)\r
- if (!sizeof_variable2 (A, &vars->variables[i], size))\r
- return GL_FALSE;\r
- return GL_TRUE;\r
-}\r
-\r
-static GLboolean collect_locals (slang_assemble_ctx *A, slang_operation *op, GLuint *size)\r
-{\r
- GLuint i;\r
-\r
- if (!sizeof_variables (A, op->locals, 0, op->locals->num_variables, size))\r
- return GL_FALSE;\r
- for (i = 0; i < op->num_children; i++)\r
- if (!collect_locals (A, &op->children[i], size))\r
- return GL_FALSE;\r
- return GL_TRUE;\r
-}\r
-\r
-/* _slang_locate_function() */\r
-\r
-slang_function *_slang_locate_function (slang_function_scope *funcs, slang_atom a_name,\r
- slang_operation *params, GLuint num_params, slang_assembly_name_space *space,\r
- slang_atom_pool *atoms)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < funcs->num_functions; i++)\r
- {\r
- GLuint j;\r
- slang_function *f = &funcs->functions[i];\r
-\r
- if (a_name != f->header.a_name)\r
- continue;\r
- if (f->param_count != num_params)\r
- continue;\r
- for (j = 0; j < num_params; j++)\r
- {\r
- slang_assembly_typeinfo ti;\r
-\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return NULL;\r
- if (!_slang_typeof_operation_ (¶ms[j], space, &ti, atoms))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return NULL;\r
- }\r
- if (!slang_type_specifier_equal (&ti.spec, &f->parameters->variables[j].type.specifier))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti);\r
- break;\r
- }\r
- slang_assembly_typeinfo_destruct (&ti);\r
-\r
- /* "out" and "inout" formal parameter requires the actual parameter to be l-value */\r
- if (!ti.can_be_referenced &&\r
- (f->parameters->variables[j].type.qualifier == slang_qual_out ||\r
- f->parameters->variables[j].type.qualifier == slang_qual_inout))\r
- break;\r
- }\r
- if (j == num_params)\r
- return f;\r
- }\r
- if (funcs->outer_scope != NULL)\r
- return _slang_locate_function (funcs->outer_scope, a_name, params, num_params, space, atoms);\r
- return NULL;\r
-}\r
-\r
-/* _slang_assemble_function() */\r
-\r
-GLboolean _slang_assemble_function (slang_assemble_ctx *A, slang_function *fun)\r
-{\r
- GLuint param_size, local_size;\r
- GLuint skip, cleanup;\r
-\r
- fun->address = A->file->count;\r
-\r
- if (fun->body == NULL)\r
- {\r
- /* jump to the actual function body - we do not know it, so add the instruction\r
- * to fixup table */\r
- fun->fixups.table = (GLuint *) slang_alloc_realloc (fun->fixups.table,\r
- fun->fixups.count * sizeof (GLuint), (fun->fixups.count + 1) * sizeof (GLuint));\r
- if (fun->fixups.table == NULL)\r
- return GL_FALSE;\r
- fun->fixups.table[fun->fixups.count] = fun->address;\r
- fun->fixups.count++;\r
- if (!PUSH (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
- return GL_TRUE;\r
- }\r
- else\r
- {\r
- GLuint i;\r
-\r
- /* resolve all fixup table entries and delete it */\r
- for (i = 0; i < fun->fixups.count; i++)\r
- A->file->code[fun->fixups.table[i]].param[0] = fun->address;\r
- slang_fixup_table_free (&fun->fixups);\r
- }\r
-\r
- /* At this point traverse function formal parameters and code to calculate\r
- * total memory size to be allocated on the stack.\r
- * During this process the variables will be assigned local addresses to\r
- * reference them in the code.\r
- * No storage optimizations are performed so exclusive scopes are not detected and shared. */\r
-\r
- /* calculate return value size */\r
- param_size = 0;\r
- if (fun->header.type.specifier.type != slang_spec_void)\r
- if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, ¶m_size))\r
- return GL_FALSE;\r
- A->local.ret_size = param_size;\r
-\r
- /* calculate formal parameter list size */\r
- if (!sizeof_variables (A, fun->parameters, 0, fun->param_count, ¶m_size))\r
- return GL_FALSE;\r
-\r
- /* calculate local variables size - take into account the four-byte return address and\r
- * temporaries for various tasks (4 for addr and 16 for swizzle temporaries).\r
- * these include variables from the formal parameter scope and from the code */\r
- A->local.addr_tmp = param_size + 4;\r
- A->local.swizzle_tmp = param_size + 4 + 4;\r
- local_size = param_size + 4 + 4 + 16;\r
- if (!sizeof_variables (A, fun->parameters, fun->param_count, fun->parameters->num_variables,\r
- &local_size))\r
- return GL_FALSE;\r
- if (!collect_locals (A, fun->body, &local_size))\r
- return GL_FALSE;\r
-\r
- /* allocate local variable storage */\r
- if (!PLAB (A->file, slang_asm_local_alloc, local_size - param_size - 4))\r
- return GL_FALSE;\r
-\r
- /* mark a new frame for function variable storage */\r
- if (!PLAB (A->file, slang_asm_enter, local_size))\r
- return GL_FALSE;\r
-\r
- /* jump directly to the actual code */\r
- skip = A->file->count;\r
- if (!push_new (A->file))\r
- return GL_FALSE;\r
- A->file->code[skip].type = slang_asm_jump;\r
-\r
- /* all "return" statements will be directed here */\r
- A->flow.function_end = A->file->count;\r
- cleanup = A->file->count;\r
- if (!push_new (A->file))\r
- return GL_FALSE;\r
- A->file->code[cleanup].type = slang_asm_jump;\r
-\r
- /* execute the function body */\r
- A->file->code[skip].param[0] = A->file->count;\r
- if (!_slang_assemble_operation (A, fun->body, /*slang_ref_freelance*/slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* this is the end of the function - restore the old function frame */\r
- A->file->code[cleanup].param[0] = A->file->count;\r
- if (!PUSH (A->file, slang_asm_leave))\r
- return GL_FALSE;\r
-\r
- /* free local variable storage */\r
- if (!PLAB (A->file, slang_asm_local_free, local_size - param_size - 4))\r
- return GL_FALSE;\r
-\r
- /* return from the function */\r
- if (!PUSH (A->file, slang_asm_return))\r
- return GL_FALSE;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean _slang_cleanup_stack (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- slang_assembly_typeinfo ti;\r
- GLuint size = 0;\r
-\r
- /* get type info of the operation and calculate its size */\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation (A, op, &ti))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return GL_FALSE;\r
- }\r
- if (ti.spec.type != slang_spec_void) {\r
- if (A->ref == slang_ref_force) {\r
- size = 4;\r
- }\r
- else if (!sizeof_variable (A, &ti.spec, slang_qual_none, 0, &size))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return GL_FALSE;\r
- }\r
- }\r
- slang_assembly_typeinfo_destruct (&ti);\r
-\r
- /* if nonzero, free it from the stack */\r
- if (size != 0)\r
- {\r
- if (!PLAB (A->file, slang_asm_local_free, size))\r
- return GL_FALSE;\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/* _slang_assemble_operation() */\r
-\r
-static GLboolean dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,\r
- GLuint *size, slang_swizzle *swz, GLboolean is_swizzled)\r
-{\r
- GLuint i;\r
-\r
- for (i = agg->count; i > 0; i--)\r
- {\r
- const slang_storage_array *arr = &agg->arrays[i - 1];\r
- GLuint j;\r
-\r
- for (j = arr->length; j > 0; j--)\r
- {\r
- if (arr->type == slang_stor_aggregate)\r
- {\r
- if (!dereference_aggregate (A, arr->aggregate, size, swz, is_swizzled))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- GLuint src_offset;\r
- slang_assembly_type ty;\r
-\r
- *size -= 4;\r
-\r
- /* calculate the offset within source variable to read */\r
- if (is_swizzled)\r
- {\r
- /* swizzle the index to get the actual offset */\r
- src_offset = swz->swizzle[*size / 4] * 4;\r
- }\r
- else\r
- {\r
- /* no swizzling - read sequentially */\r
- src_offset = *size;\r
- }\r
-\r
- /* dereference data slot of a basic type */\r
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_deref))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_addr_push, src_offset))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_add))\r
- return GL_FALSE;\r
-\r
- switch (arr->type)\r
- {\r
- case slang_stor_bool:\r
- ty = slang_asm_bool_deref;\r
- break;\r
- case slang_stor_int:\r
- ty = slang_asm_int_deref;\r
- break;\r
- case slang_stor_float:\r
- ty = slang_asm_float_deref;\r
- break;\r
- default:\r
- _mesa_problem(NULL, "Unexpected arr->type in dereference_aggregate");\r
- ty = slang_asm_none;\r
- }\r
- if (!PUSH (A->file, ty))\r
- return GL_FALSE;\r
- }\r
- }\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean _slang_dereference (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- slang_assembly_typeinfo ti;\r
- GLboolean result = GL_FALSE;\r
- slang_storage_aggregate agg;\r
- GLuint size;\r
-\r
- /* get type information of the given operation */\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation (A, op, &ti))\r
- goto end1;\r
-\r
- /* construct aggregate from the type info */\r
- if (!slang_storage_aggregate_construct (&agg))\r
- goto end1;\r
- if (!_slang_aggregate_variable (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs,\r
- A->space.vars, A->mach, A->file, A->atoms))\r
- goto end;\r
-\r
- /* dereference the resulting aggregate */\r
- size = _slang_sizeof_aggregate (&agg);\r
- result = dereference_aggregate (A, &agg, &size, &ti.swz, ti.is_swizzled);\r
-\r
-end:\r
- slang_storage_aggregate_destruct (&agg);\r
-end1:\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return result;\r
-}\r
-\r
-GLboolean _slang_assemble_function_call (slang_assemble_ctx *A, slang_function *fun,\r
- slang_operation *params, GLuint param_count, GLboolean assignment)\r
-{\r
- GLuint i;\r
- slang_swizzle p_swz[64];\r
- slang_ref_type p_ref[64];\r
-\r
- /* TODO: fix this, allocate dynamically */\r
- if (param_count > 64)\r
- return GL_FALSE;\r
-\r
- /* make room for the return value, if any */\r
- if (fun->header.type.specifier.type != slang_spec_void)\r
- {\r
- GLuint ret_size = 0;\r
-\r
- if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_local_alloc, ret_size))\r
- return GL_FALSE;\r
- }\r
-\r
- /* push the actual parameters on the stack */\r
- for (i = 0; i < param_count; i++)\r
- {\r
- if (fun->parameters->variables[i].type.qualifier == slang_qual_inout ||\r
- fun->parameters->variables[i].type.qualifier == slang_qual_out)\r
- {\r
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))\r
- return GL_FALSE;\r
- /* TODO: optimize the "out" parameter case */\r
- if (!_slang_assemble_operation (A, ¶ms[i], slang_ref_force))\r
- return GL_FALSE;\r
- p_swz[i] = A->swz;\r
- p_ref[i] = A->ref;\r
- if (!PUSH (A->file, slang_asm_addr_copy))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_deref))\r
- return GL_FALSE;\r
- if (i == 0 && assignment)\r
- {\r
- /* duplicate the resulting address */\r
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_deref))\r
- return GL_FALSE;\r
- }\r
- if (!_slang_dereference (A, ¶ms[i]))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- if (!_slang_assemble_operation (A, ¶ms[i], slang_ref_forbid))\r
- return GL_FALSE;\r
- p_swz[i] = A->swz;\r
- p_ref[i] = A->ref;\r
- }\r
- }\r
-\r
- /* call the function */\r
- if (!PLAB (A->file, slang_asm_call, fun->address))\r
- return GL_FALSE;\r
-\r
- /* pop the parameters from the stack */\r
- for (i = param_count; i > 0; i--)\r
- {\r
- GLuint j = i - 1;\r
-\r
- A->swz = p_swz[j];\r
- A->ref = p_ref[j];\r
- if (fun->parameters->variables[j].type.qualifier == slang_qual_inout ||\r
- fun->parameters->variables[j].type.qualifier == slang_qual_out)\r
- {\r
- /* for output parameter copy the contents of the formal parameter\r
- * back to the original actual parameter */\r
- if (!_slang_assemble_assignment (A, ¶ms[j]))\r
- return GL_FALSE;\r
- /* pop the actual parameter's address */\r
- if (!PLAB (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- /* pop the value of the parameter */\r
- if (!_slang_cleanup_stack (A, ¶ms[j]))\r
- return GL_FALSE;\r
- }\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *A, const char *name,\r
- slang_operation *params, GLuint param_count, GLboolean assignment)\r
-{\r
- slang_atom atom;\r
- slang_function *fun;\r
-\r
- atom = slang_atom_pool_atom (A->atoms, name);\r
- if (atom == SLANG_ATOM_NULL)\r
- return GL_FALSE;\r
- fun = _slang_locate_function (A->space.funcs, atom, params, param_count, &A->space, A->atoms);\r
- if (fun == NULL)\r
- return GL_FALSE;\r
- return _slang_assemble_function_call (A, fun, params, param_count, assignment);\r
-}\r
-\r
-static GLboolean assemble_function_call_name_dummyint (slang_assemble_ctx *A, const char *name,\r
- slang_operation *params)\r
-{\r
- slang_operation p[2];\r
- GLboolean result;\r
-\r
- p[0] = params[0];\r
- if (!slang_operation_construct (&p[1]))\r
- return GL_FALSE;\r
- p[1].type = slang_oper_literal_int;\r
- result = _slang_assemble_function_call_name (A, name, p, 2, GL_FALSE);\r
- slang_operation_destruct (&p[1]);\r
- return result;\r
-}\r
-\r
-static const struct\r
-{\r
- const char *name;\r
- slang_assembly_type code1, code2;\r
-} inst[] = {\r
- /* core */\r
- { "float_add", slang_asm_float_add, slang_asm_float_copy },\r
- { "float_multiply", slang_asm_float_multiply, slang_asm_float_copy },\r
- { "float_divide", slang_asm_float_divide, slang_asm_float_copy },\r
- { "float_negate", slang_asm_float_negate, slang_asm_float_copy },\r
- { "float_less", slang_asm_float_less, slang_asm_bool_copy },\r
- { "float_equal", slang_asm_float_equal_exp,slang_asm_bool_copy },\r
- { "float_to_int", slang_asm_float_to_int, slang_asm_int_copy },\r
- { "float_sine", slang_asm_float_sine, slang_asm_float_copy },\r
- { "float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy },\r
- { "float_arctan", slang_asm_float_arctan, slang_asm_float_copy },\r
- { "float_power", slang_asm_float_power, slang_asm_float_copy },\r
- { "float_log2", slang_asm_float_log2, slang_asm_float_copy },\r
- { "float_floor", slang_asm_float_floor, slang_asm_float_copy },\r
- { "float_ceil", slang_asm_float_ceil, slang_asm_float_copy },\r
- { "float_noise1", slang_asm_float_noise1, slang_asm_float_copy },\r
- { "float_noise2", slang_asm_float_noise2, slang_asm_float_copy },\r
- { "float_noise3", slang_asm_float_noise3, slang_asm_float_copy },\r
- { "float_noise4", slang_asm_float_noise4, slang_asm_float_copy },\r
- { "int_to_float", slang_asm_int_to_float, slang_asm_float_copy },\r
- { "vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none },\r
- { "vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none },\r
- { "vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none },\r
- { "vec4_texcube", slang_asm_vec4_texcube, slang_asm_none },\r
- { "vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none },\r
- { "vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none },\r
- /* mesa-specific extensions */\r
- { "float_print", slang_asm_float_deref, slang_asm_float_print },\r
- { "int_print", slang_asm_int_deref, slang_asm_int_print },\r
- { "bool_print", slang_asm_bool_deref, slang_asm_bool_print },\r
- { NULL, slang_asm_none, slang_asm_none }\r
-};\r
-\r
-static GLboolean call_asm_instruction (slang_assemble_ctx *A, slang_atom a_name)\r
-{\r
- const char *id;\r
- GLuint i;\r
-\r
- id = slang_atom_pool_id (A->atoms, a_name);\r
-\r
- for (i = 0; inst[i].name != NULL; i++)\r
- if (slang_string_compare (id, inst[i].name) == 0)\r
- break;\r
- if (inst[i].name == NULL)\r
- return GL_FALSE;\r
-\r
- if (!PLAB2 (A->file, inst[i].code1, 4, 0))\r
- return GL_FALSE;\r
- if (inst[i].code2 != slang_asm_none)\r
- if (!PLAB2 (A->file, inst[i].code2, 4, 0))\r
- return GL_FALSE;\r
-\r
- /* clean-up the stack from the remaining dst address */\r
- if (!PLAB (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-static GLboolean equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,\r
- GLuint *index, GLuint size, GLuint z_label)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < agg->count; i++)\r
- {\r
- const slang_storage_array *arr = &agg->arrays[i];\r
- GLuint j;\r
-\r
- for (j = 0; j < arr->length; j++)\r
- {\r
- if (arr->type == slang_stor_aggregate)\r
- {\r
- if (!equality_aggregate (A, arr->aggregate, index, size, z_label))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- if (!PLAB2 (A->file, slang_asm_float_equal_int, size + *index, *index))\r
- return GL_FALSE;\r
- *index += 4;\r
- if (!PLAB (A->file, slang_asm_jump_if_zero, z_label))\r
- return GL_FALSE;\r
- }\r
- }\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-static GLboolean equality (slang_assemble_ctx *A, slang_operation *op, GLboolean equal)\r
-{\r
- slang_assembly_typeinfo ti;\r
- GLboolean result = GL_FALSE;\r
- slang_storage_aggregate agg;\r
- GLuint index, size;\r
- GLuint skip_jump, true_label, true_jump, false_label, false_jump;\r
-\r
- /* get type of operation */\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation (A, op, &ti))\r
- goto end1;\r
-\r
- /* convert it to an aggregate */\r
- if (!slang_storage_aggregate_construct (&agg))\r
- goto end1;\r
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,\r
- A->space.vars, A->mach, A->file, A->atoms))\r
- goto end;\r
-\r
- /* compute the size of the agregate - there are two such aggregates on the stack */\r
- size = _slang_sizeof_aggregate (&agg);\r
-\r
- /* jump to the actual data-comparison code */\r
- skip_jump = A->file->count;\r
- if (!PUSH (A->file, slang_asm_jump))\r
- goto end;\r
-\r
- /* pop off the stack the compared data and push 1 */\r
- true_label = A->file->count;\r
- if (!PLAB (A->file, slang_asm_local_free, size * 2))\r
- goto end;\r
- if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 1))\r
- goto end;\r
- true_jump = A->file->count;\r
- if (!PUSH (A->file, slang_asm_jump))\r
- goto end;\r
-\r
- false_label = A->file->count;\r
- if (!PLAB (A->file, slang_asm_local_free, size * 2))\r
- goto end;\r
- if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 0))\r
- goto end;\r
- false_jump = A->file->count;\r
- if (!PUSH (A->file, slang_asm_jump))\r
- goto end;\r
-\r
- A->file->code[skip_jump].param[0] = A->file->count;\r
-\r
- /* compare the data on stack, it will eventually jump either to true or false label */\r
- index = 0;\r
- if (!equality_aggregate (A, &agg, &index, size, equal ? false_label : true_label))\r
- goto end;\r
- if (!PLAB (A->file, slang_asm_jump, equal ? true_label : false_label))\r
- goto end;\r
-\r
- A->file->code[true_jump].param[0] = A->file->count;\r
- A->file->code[false_jump].param[0] = A->file->count;\r
-\r
- result = GL_TRUE;\r
-end:\r
- slang_storage_aggregate_destruct (&agg);\r
-end1:\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return result;\r
-}\r
-\r
-static GLboolean handle_subscript (slang_assemble_ctx *A, slang_assembly_typeinfo *tie,\r
- slang_assembly_typeinfo *tia, slang_operation *op, slang_ref_type ref)\r
-{\r
- GLuint asize = 0, esize = 0;\r
-\r
- /* get type info of the master expression (matrix, vector or an array */\r
- if (!_slang_typeof_operation (A, &op->children[0], tia))\r
- return GL_FALSE;\r
- if (!sizeof_variable (A, &tia->spec, slang_qual_none, tia->array_len, &asize))\r
- return GL_FALSE;\r
-\r
- /* get type info of the result (matrix column, vector row or array element) */\r
- if (!_slang_typeof_operation (A, op, tie))\r
- return GL_FALSE;\r
- if (!sizeof_variable (A, &tie->spec, slang_qual_none, 0, &esize))\r
- return GL_FALSE;\r
-\r
- /* assemble the master expression */\r
- if (!_slang_assemble_operation (A, &op->children[0], ref))\r
- return GL_FALSE;\r
-\r
- /* when indexing an l-value swizzle, push the swizzle_tmp */\r
- if (ref == slang_ref_force && tia->is_swizzled)\r
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))\r
- return GL_FALSE;\r
-\r
- /* assemble the subscript expression */\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- if (ref == slang_ref_force && tia->is_swizzled)\r
- {\r
- GLuint i;\r
-\r
- /* copy the swizzle indexes to the swizzle_tmp */\r
- for (i = 0; i < tia->swz.num_components; i++)\r
- {\r
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_addr_push, i * 4))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_add))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_addr_push, tia->swz.swizzle[i]))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_copy))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
- }\r
-\r
- /* offset the pushed swizzle_tmp address and dereference it */\r
- if (!PUSH (A->file, slang_asm_int_to_addr))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_addr_push, 4))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_multiply))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_add))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_deref))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- /* convert the integer subscript to a relative address */\r
- if (!PUSH (A->file, slang_asm_int_to_addr))\r
- return GL_FALSE;\r
- }\r
-\r
- if (!PLAB (A->file, slang_asm_addr_push, esize))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_addr_multiply))\r
- return GL_FALSE;\r
-\r
- if (ref == slang_ref_force)\r
- {\r
- /* offset the base address with the relative address */\r
- if (!PUSH (A->file, slang_asm_addr_add))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- GLuint i;\r
-\r
- /* move the selected element to the beginning of the master expression */\r
- for (i = 0; i < esize; i += 4)\r
- if (!PLAB2 (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
-\r
- /* free the rest of the master expression */\r
- if (!PLAB (A->file, slang_asm_local_free, asize - esize))\r
- return GL_FALSE;\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-static GLboolean handle_field (slang_assemble_ctx *A, slang_assembly_typeinfo *tia,\r
- slang_assembly_typeinfo *tib, slang_operation *op, slang_ref_type ref)\r
-{\r
- /* get type info of the result (field or swizzle) */\r
- if (!_slang_typeof_operation (A, op, tia))\r
- return GL_FALSE;\r
-\r
- /* get type info of the master expression being accessed (struct or vector) */\r
- if (!_slang_typeof_operation (A, &op->children[0], tib))\r
- return GL_FALSE;\r
-\r
- /* if swizzling a vector in-place, the swizzle temporary is needed */\r
- if (ref == slang_ref_forbid && tia->is_swizzled)\r
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))\r
- return GL_FALSE;\r
-\r
- /* assemble the master expression */\r
- if (!_slang_assemble_operation (A, &op->children[0], ref))\r
- return GL_FALSE;\r
-\r
- /* assemble the field expression */\r
- if (tia->is_swizzled)\r
- {\r
- if (ref == slang_ref_force)\r
- {\r
-#if 0\r
- if (tia->swz.num_components == 1)\r
- {\r
- /* simple case - adjust the vector's address to point to the selected component */\r
- if (!PLAB (file, slang_asm_addr_push, tia->swz.swizzle[0] * 4))\r
- return 0;\r
- if (!PUSH (file, slang_asm_addr_add))\r
- return 0;\r
- }\r
- else\r
-#endif\r
- {\r
- /* two or more vector components are being referenced - the so-called write mask\r
- * must be passed to the upper operations and applied when assigning value\r
- * to this swizzle */\r
- A->swz = tia->swz;\r
- }\r
- }\r
- else\r
- {\r
- /* swizzle the vector in-place using the swizzle temporary */\r
- if (!_slang_assemble_constructor_from_swizzle (A, &tia->swz, &tia->spec, &tib->spec))\r
- return GL_FALSE;\r
- }\r
- }\r
- else\r
- {\r
- GLuint i, struct_size = 0, field_offset = 0, field_size = 0;\r
- GLboolean relocate, shrink;\r
-\r
- /* calculate struct size, field offset and field size */\r
- for (i = 0; i < tib->spec._struct->fields->num_variables; i++)\r
- {\r
- slang_variable *field;\r
- slang_storage_aggregate agg;\r
- GLuint size;\r
-\r
- field = &tib->spec._struct->fields->variables[i];\r
- if (!slang_storage_aggregate_construct (&agg))\r
- return GL_FALSE;\r
- if (!_slang_aggregate_variable (&agg, &field->type.specifier, field->array_len,\r
- A->space.funcs, A->space.structs, A->space.vars, A->mach, A->file, A->atoms))\r
- {\r
- slang_storage_aggregate_destruct (&agg);\r
- return GL_FALSE;\r
- }\r
- size = _slang_sizeof_aggregate (&agg);\r
- slang_storage_aggregate_destruct (&agg);\r
-\r
- if (op->a_id == field->a_name)\r
- {\r
- field_size = size;\r
- struct_size = field_offset + size;\r
- }\r
- else if (struct_size != 0)\r
- struct_size += size;\r
- else\r
- field_offset += size;\r
- }\r
-\r
- /*\r
- * OPTIMIZATION: If selecting the last field, no relocation is needed.\r
- */\r
- relocate = field_offset != struct_size - field_size;\r
-\r
- /*\r
- * OPTIMIZATION: If field and struct sizes are equal, no partial free is needed.\r
- */\r
- shrink = field_size != struct_size;\r
-\r
- if (relocate)\r
- {\r
- if (!PLAB (A->file, slang_asm_addr_push, field_offset))\r
- return GL_FALSE;\r
- }\r
-\r
- if (ref == slang_ref_force)\r
- {\r
- if (relocate)\r
- {\r
- if (!PUSH (A->file, slang_asm_addr_add))\r
- return GL_FALSE;\r
- }\r
- }\r
- else\r
- {\r
- GLuint free_b = 0;\r
-\r
- if (relocate)\r
- {\r
- GLuint i;\r
-\r
- /*\r
- * Move the selected element to the end of the master expression.\r
- * Do it in reverse order to avoid overwriting itself.\r
- */\r
- for (i = field_size; i > 0; i -= 4)\r
- if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i, i))\r
- return GL_FALSE;\r
- free_b += 4;\r
- }\r
-\r
- if (shrink)\r
- {\r
- /* free the rest of the master expression */\r
- free_b += struct_size - field_size;\r
- }\r
-\r
- if (free_b)\r
- {\r
- if (!PLAB (A->file, slang_asm_local_free, free_b))\r
- return GL_FALSE;\r
- }\r
- }\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean _slang_assemble_operation (slang_assemble_ctx *A, slang_operation *op, slang_ref_type ref)\r
-{\r
- /* set default results */\r
- A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ref;\r
- A->swz.num_components = 0;\r
-\r
- switch (op->type)\r
- {\r
- case slang_oper_block_no_new_scope:\r
- case slang_oper_block_new_scope:\r
- {\r
- GLuint i;\r
-\r
- for (i = 0; i < op->num_children; i++)\r
- {\r
- if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[i]))\r
- return GL_FALSE;\r
- }\r
- }\r
- break;\r
- case slang_oper_variable_decl:\r
- {\r
- GLuint i;\r
- slang_operation assign;\r
- GLboolean result;\r
-\r
- /* Construct assignment expression placeholder. */\r
- if (!slang_operation_construct (&assign))\r
- return GL_FALSE;\r
- assign.type = slang_oper_assign;\r
- assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));\r
- if (assign.children == NULL)\r
- {\r
- slang_operation_destruct (&assign);\r
- return GL_FALSE;\r
- }\r
- for (assign.num_children = 0; assign.num_children < 2; assign.num_children++)\r
- if (!slang_operation_construct (&assign.children[assign.num_children]))\r
- {\r
- slang_operation_destruct (&assign);\r
- return GL_FALSE;\r
- }\r
-\r
- result = GL_TRUE;\r
- for (i = 0; i < op->num_children; i++)\r
- {\r
- slang_variable *var;\r
-\r
- var = _slang_locate_variable (op->children[i].locals, op->children[i].a_id, GL_TRUE);\r
- if (var == NULL)\r
- {\r
- result = GL_FALSE;\r
- break;\r
- }\r
- if (var->initializer == NULL)\r
- continue;\r
-\r
- if (!slang_operation_copy (&assign.children[0], &op->children[i]) ||\r
- !slang_operation_copy (&assign.children[1], var->initializer) ||\r
- !_slang_assemble_assign (A, &assign, "=", slang_ref_forbid) ||\r
- !_slang_cleanup_stack (A, &assign))\r
- {\r
- result = GL_FALSE;\r
- break;\r
- }\r
- }\r
- slang_operation_destruct (&assign);\r
- if (!result)\r
- return GL_FALSE;\r
- }\r
- break;\r
- case slang_oper_asm:\r
- {\r
- GLuint i;\r
-\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))\r
- return GL_FALSE;\r
- for (i = 1; i < op->num_children; i++)\r
- if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid))\r
- return GL_FALSE;\r
- if (!call_asm_instruction (A, op->a_id))\r
- return GL_FALSE;\r
- }\r
- break;\r
- case slang_oper_break:\r
- if (!PLAB (A->file, slang_asm_jump, A->flow.loop_end))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_continue:\r
- if (!PLAB (A->file, slang_asm_jump, A->flow.loop_start))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_discard:\r
- if (!PUSH (A->file, slang_asm_discard))\r
- return GL_FALSE;\r
- if (!PUSH (A->file, slang_asm_exit))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_return:\r
- if (A->local.ret_size != 0)\r
- {\r
- /* push the result's address */\r
- if (!PLAB2 (A->file, slang_asm_local_addr, 0, A->local.ret_size))\r
- return GL_FALSE;\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- A->swz.num_components = 0;\r
- /* assign the operation to the function result (it was reserved on the stack) */\r
- if (!_slang_assemble_assignment (A, op->children))\r
- return GL_FALSE;\r
-\r
- if (!PLAB (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
- }\r
- if (!PLAB (A->file, slang_asm_jump, A->flow.function_end))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_expression:\r
- if (ref == slang_ref_force)\r
- return GL_FALSE;\r
- if (!_slang_assemble_operation (A, &op->children[0], ref))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_if:\r
- if (!_slang_assemble_if (A, op))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_while:\r
- if (!_slang_assemble_while (A, op))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_do:\r
- if (!_slang_assemble_do (A, op))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_for:\r
- if (!_slang_assemble_for (A, op))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_void:\r
- break;\r
- case slang_oper_literal_bool:\r
- if (ref == slang_ref_force)\r
- return GL_FALSE;\r
- if (!PLIT (A->file, slang_asm_bool_push, op->literal))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_literal_int:\r
- if (ref == slang_ref_force)\r
- return GL_FALSE;\r
- if (!PLIT (A->file, slang_asm_int_push, op->literal))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_literal_float:\r
- if (ref == slang_ref_force)\r
- return GL_FALSE;\r
- if (!PLIT (A->file, slang_asm_float_push, op->literal))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_identifier:\r
- {\r
- slang_variable *var;\r
- GLuint size;\r
-\r
- /* find the variable and calculate its size */\r
- var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);\r
- if (var == NULL)\r
- return GL_FALSE;\r
- size = 0;\r
- if (!sizeof_variable (A, &var->type.specifier, slang_qual_none, var->array_len, &size))\r
- return GL_FALSE;\r
-\r
- /* prepare stack for dereferencing */\r
- if (ref == slang_ref_forbid)\r
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))\r
- return GL_FALSE;\r
-\r
- /* push the variable's address */\r
- if (var->global)\r
- {\r
- if (!PLAB (A->file, slang_asm_global_addr, var->address))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- if (!PLAB2 (A->file, slang_asm_local_addr, var->address, size))\r
- return GL_FALSE;\r
- }\r
-\r
- /* perform the dereference */\r
- if (ref == slang_ref_forbid)\r
- {\r
- if (!PUSH (A->file, slang_asm_addr_copy))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
- if (!_slang_dereference (A, op))\r
- return GL_FALSE;\r
- }\r
- }\r
- break;\r
- case slang_oper_sequence:\r
- if (ref == slang_ref_force)\r
- return GL_FALSE;\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[0]))\r
- return GL_FALSE;\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_assign:\r
- if (!_slang_assemble_assign (A, op, "=", ref))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_addassign:\r
- if (!_slang_assemble_assign (A, op, "+=", ref))\r
- return GL_FALSE;\r
- A->ref = ref;\r
- break;\r
- case slang_oper_subassign:\r
- if (!_slang_assemble_assign (A, op, "-=", ref))\r
- return GL_FALSE;\r
- A->ref = ref;\r
- break;\r
- case slang_oper_mulassign:\r
- if (!_slang_assemble_assign (A, op, "*=", ref))\r
- return GL_FALSE;\r
- A->ref = ref;\r
- break;\r
- /*case slang_oper_modassign:*/\r
- /*case slang_oper_lshassign:*/\r
- /*case slang_oper_rshassign:*/\r
- /*case slang_oper_orassign:*/\r
- /*case slang_oper_xorassign:*/\r
- /*case slang_oper_andassign:*/\r
- case slang_oper_divassign:\r
- if (!_slang_assemble_assign (A, op, "/=", ref))\r
- return GL_FALSE;\r
- A->ref = ref;\r
- break;\r
- case slang_oper_select:\r
- if (!_slang_assemble_select (A, op))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_logicalor:\r
- if (!_slang_assemble_logicalor (A, op))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_logicaland:\r
- if (!_slang_assemble_logicaland (A, op))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_logicalxor:\r
- if (!_slang_assemble_function_call_name (A, "^^", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- /*case slang_oper_bitor:*/\r
- /*case slang_oper_bitxor:*/\r
- /*case slang_oper_bitand:*/\r
- case slang_oper_less:\r
- if (!_slang_assemble_function_call_name (A, "<", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_greater:\r
- if (!_slang_assemble_function_call_name (A, ">", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_lessequal:\r
- if (!_slang_assemble_function_call_name (A, "<=", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_greaterequal:\r
- if (!_slang_assemble_function_call_name (A, ">=", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- /*case slang_oper_lshift:*/\r
- /*case slang_oper_rshift:*/\r
- case slang_oper_add:\r
- if (!_slang_assemble_function_call_name (A, "+", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_subtract:\r
- if (!_slang_assemble_function_call_name (A, "-", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_multiply:\r
- if (!_slang_assemble_function_call_name (A, "*", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- /*case slang_oper_modulus:*/\r
- case slang_oper_divide:\r
- if (!_slang_assemble_function_call_name (A, "/", op->children, 2, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_equal:\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
- if (!equality (A, op->children, GL_TRUE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_notequal:\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
- if (!equality (A, op->children, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_preincrement:\r
- if (!_slang_assemble_assign (A, op, "++", ref))\r
- return GL_FALSE;\r
- A->ref = ref;\r
- break;\r
- case slang_oper_predecrement:\r
- if (!_slang_assemble_assign (A, op, "--", ref))\r
- return GL_FALSE;\r
- A->ref = ref;\r
- break;\r
- case slang_oper_plus:\r
- if (!_slang_dereference (A, op))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_minus:\r
- if (!_slang_assemble_function_call_name (A, "-", op->children, 1, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- /*case slang_oper_complement:*/\r
- case slang_oper_not:\r
- if (!_slang_assemble_function_call_name (A, "!", op->children, 1, GL_FALSE))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_subscript:\r
- {\r
- slang_assembly_typeinfo ti_arr, ti_elem;\r
-\r
- if (!slang_assembly_typeinfo_construct (&ti_arr))\r
- return GL_FALSE;\r
- if (!slang_assembly_typeinfo_construct (&ti_elem))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti_arr);\r
- return GL_FALSE;\r
- }\r
- if (!handle_subscript (A, &ti_elem, &ti_arr, op, ref))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti_arr);\r
- slang_assembly_typeinfo_destruct (&ti_elem);\r
- return GL_FALSE;\r
- }\r
- slang_assembly_typeinfo_destruct (&ti_arr);\r
- slang_assembly_typeinfo_destruct (&ti_elem);\r
- }\r
- break;\r
- case slang_oper_call:\r
- {\r
- slang_function *fun;\r
-\r
- fun = _slang_locate_function (A->space.funcs, op->a_id, op->children, op->num_children,\r
- &A->space, A->atoms);\r
- if (fun == NULL)\r
- {\r
- if (!_slang_assemble_constructor (A, op))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- if (!_slang_assemble_function_call (A, fun, op->children, op->num_children, GL_FALSE))\r
- return GL_FALSE;\r
- }\r
- A->ref = slang_ref_forbid;\r
- }\r
- break;\r
- case slang_oper_field:\r
- {\r
- slang_assembly_typeinfo ti_after, ti_before;\r
-\r
- if (!slang_assembly_typeinfo_construct (&ti_after))\r
- return GL_FALSE;\r
- if (!slang_assembly_typeinfo_construct (&ti_before))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti_after);\r
- return GL_FALSE;\r
- }\r
- if (!handle_field (A, &ti_after, &ti_before, op, ref))\r
- {\r
- slang_assembly_typeinfo_destruct (&ti_after);\r
- slang_assembly_typeinfo_destruct (&ti_before);\r
- return GL_FALSE;\r
- }\r
- slang_assembly_typeinfo_destruct (&ti_after);\r
- slang_assembly_typeinfo_destruct (&ti_before);\r
- }\r
- break;\r
- case slang_oper_postincrement:\r
- if (!assemble_function_call_name_dummyint (A, "++", op->children))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- case slang_oper_postdecrement:\r
- if (!assemble_function_call_name_dummyint (A, "--", op->children))\r
- return GL_FALSE;\r
- A->ref = slang_ref_forbid;\r
- break;\r
- default:\r
- return GL_FALSE;\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_assemble.c
+ * slang intermediate code assembler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_assemble.h"
+#include "slang_compile.h"
+#include "slang_storage.h"
+
+/* slang_assembly */
+
+static GLboolean slang_assembly_construct (slang_assembly *assem)
+{
+ assem->type = slang_asm_none;
+ return GL_TRUE;
+}
+
+static GLvoid slang_assembly_destruct (slang_assembly *assem)
+{
+}
+
+/* slang_assembly_file */
+
+GLboolean slang_assembly_file_construct (slang_assembly_file *file)
+{
+ file->code = NULL;
+ file->count = 0;
+ file->capacity = 0;
+ return GL_TRUE;
+}
+
+GLvoid slang_assembly_file_destruct (slang_assembly_file *file)
+{
+ GLuint i;
+
+ for (i = 0; i < file->count; i++)
+ slang_assembly_destruct (&file->code[i]);
+ slang_alloc_free (file->code);
+}
+
+static GLboolean push_new (slang_assembly_file *file)
+{
+ if (file->count == file->capacity)
+ {
+ GLuint n;
+
+ if (file->capacity == 0)
+ n = 256;
+ else
+ n = file->capacity * 2;
+ file->code = (slang_assembly *) slang_alloc_realloc (file->code,
+ file->capacity * sizeof (slang_assembly), n * sizeof (slang_assembly));
+ if (file->code == NULL)
+ return GL_FALSE;
+ file->capacity = n;
+ }
+ if (!slang_assembly_construct (&file->code[file->count]))
+ return GL_FALSE;
+ file->count++;
+ return GL_TRUE;
+}
+
+static GLboolean push_gen (slang_assembly_file *file, slang_assembly_type type, GLfloat literal,
+ GLuint label, GLuint size)
+{
+ slang_assembly *assem;
+
+ if (!push_new (file))
+ return GL_FALSE;
+ assem = &file->code[file->count - 1];
+ assem->type = type;
+ assem->literal = literal;
+ assem->param[0] = label;
+ assem->param[1] = size;
+ return GL_TRUE;
+}
+
+GLboolean slang_assembly_file_push (slang_assembly_file *file, slang_assembly_type type)
+{
+ return push_gen (file, type, (GLfloat) 0, 0, 0);
+}
+
+GLboolean slang_assembly_file_push_label (slang_assembly_file *file, slang_assembly_type type,
+ GLuint label)
+{
+ return push_gen (file, type, (GLfloat) 0, label, 0);
+}
+
+GLboolean slang_assembly_file_push_label2 (slang_assembly_file *file, slang_assembly_type type,
+ GLuint label1, GLuint label2)
+{
+ return push_gen (file, type, (GLfloat) 0, label1, label2);
+}
+
+GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_assembly_type type,
+ GLfloat literal)
+{
+ return push_gen (file, type, literal, 0, 0);
+}
+
+#define PUSH slang_assembly_file_push
+#define PLAB slang_assembly_file_push_label
+#define PLAB2 slang_assembly_file_push_label2
+#define PLIT slang_assembly_file_push_literal
+
+/* slang_assembly_file_restore_point */
+
+GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *file,
+ slang_assembly_file_restore_point *point)
+{
+ point->count = file->count;
+ return GL_TRUE;
+}
+
+GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *file,
+ slang_assembly_file_restore_point *point)
+{
+ GLuint i;
+
+ for (i = point->count; i < file->count; i++)
+ slang_assembly_destruct (&file->code[i]);
+ file->count = point->count;
+ return GL_TRUE;
+}
+
+/* utility functions */
+
+static GLboolean sizeof_variable (slang_assemble_ctx *A, slang_type_specifier *spec,
+ slang_type_qualifier qual, GLuint array_len, GLuint *size)
+{
+ slang_storage_aggregate agg;
+
+ /* calculate the size of the variable's aggregate */
+ if (!slang_storage_aggregate_construct (&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable (&agg, spec, array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ {
+ slang_storage_aggregate_destruct (&agg);
+ return GL_FALSE;
+ }
+ *size += _slang_sizeof_aggregate (&agg);
+ slang_storage_aggregate_destruct (&agg);
+
+ /* for reference variables consider the additional address overhead */
+ if (qual == slang_qual_out || qual == slang_qual_inout)
+ *size += 4;
+
+ return GL_TRUE;
+}
+
+static GLboolean sizeof_variable2 (slang_assemble_ctx *A, slang_variable *var, GLuint *size)
+{
+ var->address = *size;
+ if (var->type.qualifier == slang_qual_out || var->type.qualifier == slang_qual_inout)
+ var->address += 4;
+ return sizeof_variable (A, &var->type.specifier, var->type.qualifier, var->array_len, size);
+}
+
+static GLboolean sizeof_variables (slang_assemble_ctx *A, slang_variable_scope *vars, GLuint start,
+ GLuint stop, GLuint *size)
+{
+ GLuint i;
+
+ for (i = start; i < stop; i++)
+ if (!sizeof_variable2 (A, &vars->variables[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
+}
+
+static GLboolean collect_locals (slang_assemble_ctx *A, slang_operation *op, GLuint *size)
+{
+ GLuint i;
+
+ if (!sizeof_variables (A, op->locals, 0, op->locals->num_variables, size))
+ return GL_FALSE;
+ for (i = 0; i < op->num_children; i++)
+ if (!collect_locals (A, &op->children[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
+}
+
+/* _slang_locate_function() */
+
+slang_function *_slang_locate_function (slang_function_scope *funcs, slang_atom a_name,
+ slang_operation *params, GLuint num_params, slang_assembly_name_space *space,
+ slang_atom_pool *atoms)
+{
+ GLuint i;
+
+ for (i = 0; i < funcs->num_functions; i++)
+ {
+ GLuint j;
+ slang_function *f = &funcs->functions[i];
+
+ if (a_name != f->header.a_name)
+ continue;
+ if (f->param_count != num_params)
+ continue;
+ for (j = 0; j < num_params; j++)
+ {
+ slang_assembly_typeinfo ti;
+
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return NULL;
+ if (!_slang_typeof_operation_ (¶ms[j], space, &ti, atoms))
+ {
+ slang_assembly_typeinfo_destruct (&ti);
+ return NULL;
+ }
+ if (!slang_type_specifier_equal (&ti.spec, &f->parameters->variables[j].type.specifier))
+ {
+ slang_assembly_typeinfo_destruct (&ti);
+ break;
+ }
+ slang_assembly_typeinfo_destruct (&ti);
+
+ /* "out" and "inout" formal parameter requires the actual parameter to be l-value */
+ if (!ti.can_be_referenced &&
+ (f->parameters->variables[j].type.qualifier == slang_qual_out ||
+ f->parameters->variables[j].type.qualifier == slang_qual_inout))
+ break;
+ }
+ if (j == num_params)
+ return f;
+ }
+ if (funcs->outer_scope != NULL)
+ return _slang_locate_function (funcs->outer_scope, a_name, params, num_params, space, atoms);
+ return NULL;
+}
+
+/* _slang_assemble_function() */
+
+GLboolean _slang_assemble_function (slang_assemble_ctx *A, slang_function *fun)
+{
+ GLuint param_size, local_size;
+ GLuint skip, cleanup;
+
+ fun->address = A->file->count;
+
+ if (fun->body == NULL)
+ {
+ /* jump to the actual function body - we do not know it, so add the instruction
+ * to fixup table */
+ fun->fixups.table = (GLuint *) slang_alloc_realloc (fun->fixups.table,
+ fun->fixups.count * sizeof (GLuint), (fun->fixups.count + 1) * sizeof (GLuint));
+ if (fun->fixups.table == NULL)
+ return GL_FALSE;
+ fun->fixups.table[fun->fixups.count] = fun->address;
+ fun->fixups.count++;
+ if (!PUSH (A->file, slang_asm_jump))
+ return GL_FALSE;
+ return GL_TRUE;
+ }
+ else
+ {
+ GLuint i;
+
+ /* resolve all fixup table entries and delete it */
+ for (i = 0; i < fun->fixups.count; i++)
+ A->file->code[fun->fixups.table[i]].param[0] = fun->address;
+ slang_fixup_table_free (&fun->fixups);
+ }
+
+ /* At this point traverse function formal parameters and code to calculate
+ * total memory size to be allocated on the stack.
+ * During this process the variables will be assigned local addresses to
+ * reference them in the code.
+ * No storage optimizations are performed so exclusive scopes are not detected and shared. */
+
+ /* calculate return value size */
+ param_size = 0;
+ if (fun->header.type.specifier.type != slang_spec_void)
+ if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, ¶m_size))
+ return GL_FALSE;
+ A->local.ret_size = param_size;
+
+ /* calculate formal parameter list size */
+ if (!sizeof_variables (A, fun->parameters, 0, fun->param_count, ¶m_size))
+ return GL_FALSE;
+
+ /* calculate local variables size - take into account the four-byte return address and
+ * temporaries for various tasks (4 for addr and 16 for swizzle temporaries).
+ * these include variables from the formal parameter scope and from the code */
+ A->local.addr_tmp = param_size + 4;
+ A->local.swizzle_tmp = param_size + 4 + 4;
+ local_size = param_size + 4 + 4 + 16;
+ if (!sizeof_variables (A, fun->parameters, fun->param_count, fun->parameters->num_variables,
+ &local_size))
+ return GL_FALSE;
+ if (!collect_locals (A, fun->body, &local_size))
+ return GL_FALSE;
+
+ /* allocate local variable storage */
+ if (!PLAB (A->file, slang_asm_local_alloc, local_size - param_size - 4))
+ return GL_FALSE;
+
+ /* mark a new frame for function variable storage */
+ if (!PLAB (A->file, slang_asm_enter, local_size))
+ return GL_FALSE;
+
+ /* jump directly to the actual code */
+ skip = A->file->count;
+ if (!push_new (A->file))
+ return GL_FALSE;
+ A->file->code[skip].type = slang_asm_jump;
+
+ /* all "return" statements will be directed here */
+ A->flow.function_end = A->file->count;
+ cleanup = A->file->count;
+ if (!push_new (A->file))
+ return GL_FALSE;
+ A->file->code[cleanup].type = slang_asm_jump;
+
+ /* execute the function body */
+ A->file->code[skip].param[0] = A->file->count;
+ if (!_slang_assemble_operation (A, fun->body, /*slang_ref_freelance*/slang_ref_forbid))
+ return GL_FALSE;
+
+ /* this is the end of the function - restore the old function frame */
+ A->file->code[cleanup].param[0] = A->file->count;
+ if (!PUSH (A->file, slang_asm_leave))
+ return GL_FALSE;
+
+ /* free local variable storage */
+ if (!PLAB (A->file, slang_asm_local_free, local_size - param_size - 4))
+ return GL_FALSE;
+
+ /* return from the function */
+ if (!PUSH (A->file, slang_asm_return))
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+GLboolean _slang_cleanup_stack (slang_assemble_ctx *A, slang_operation *op)
+{
+ slang_assembly_typeinfo ti;
+ GLuint size = 0;
+
+ /* get type info of the operation and calculate its size */
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ {
+ slang_assembly_typeinfo_destruct (&ti);
+ return GL_FALSE;
+ }
+ if (ti.spec.type != slang_spec_void) {
+ if (A->ref == slang_ref_force) {
+ size = 4;
+ }
+ else if (!sizeof_variable (A, &ti.spec, slang_qual_none, 0, &size))
+ {
+ slang_assembly_typeinfo_destruct (&ti);
+ return GL_FALSE;
+ }
+ }
+ slang_assembly_typeinfo_destruct (&ti);
+
+ /* if nonzero, free it from the stack */
+ if (size != 0)
+ {
+ if (!PLAB (A->file, slang_asm_local_free, size))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+/* _slang_assemble_operation() */
+
+static GLboolean dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,
+ GLuint *size, slang_swizzle *swz, GLboolean is_swizzled)
+{
+ GLuint i;
+
+ for (i = agg->count; i > 0; i--)
+ {
+ const slang_storage_array *arr = &agg->arrays[i - 1];
+ GLuint j;
+
+ for (j = arr->length; j > 0; j--)
+ {
+ if (arr->type == slang_stor_aggregate)
+ {
+ if (!dereference_aggregate (A, arr->aggregate, size, swz, is_swizzled))
+ return GL_FALSE;
+ }
+ else
+ {
+ GLuint src_offset;
+ slang_assembly_type ty;
+
+ *size -= 4;
+
+ /* calculate the offset within source variable to read */
+ if (is_swizzled)
+ {
+ /* swizzle the index to get the actual offset */
+ src_offset = swz->swizzle[*size / 4] * 4;
+ }
+ else
+ {
+ /* no swizzling - read sequentially */
+ src_offset = *size;
+ }
+
+ /* dereference data slot of a basic type */
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, src_offset))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+
+ switch (arr->type)
+ {
+ case slang_stor_bool:
+ ty = slang_asm_bool_deref;
+ break;
+ case slang_stor_int:
+ ty = slang_asm_int_deref;
+ break;
+ case slang_stor_float:
+ ty = slang_asm_float_deref;
+ break;
+ default:
+ _mesa_problem(NULL, "Unexpected arr->type in dereference_aggregate");
+ ty = slang_asm_none;
+ }
+ if (!PUSH (A->file, ty))
+ return GL_FALSE;
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean _slang_dereference (slang_assemble_ctx *A, slang_operation *op)
+{
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint size;
+
+ /* get type information of the given operation */
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ /* construct aggregate from the type info */
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end;
+
+ /* dereference the resulting aggregate */
+ size = _slang_sizeof_aggregate (&agg);
+ result = dereference_aggregate (A, &agg, &size, &ti.swz, ti.is_swizzled);
+
+end:
+ slang_storage_aggregate_destruct (&agg);
+end1:
+ slang_assembly_typeinfo_destruct (&ti);
+ return result;
+}
+
+GLboolean _slang_assemble_function_call (slang_assemble_ctx *A, slang_function *fun,
+ slang_operation *params, GLuint param_count, GLboolean assignment)
+{
+ GLuint i;
+ slang_swizzle p_swz[64];
+ slang_ref_type p_ref[64];
+
+ /* TODO: fix this, allocate dynamically */
+ if (param_count > 64)
+ return GL_FALSE;
+
+ /* make room for the return value, if any */
+ if (fun->header.type.specifier.type != slang_spec_void)
+ {
+ GLuint ret_size = 0;
+
+ if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_alloc, ret_size))
+ return GL_FALSE;
+ }
+
+ /* push the actual parameters on the stack */
+ for (i = 0; i < param_count; i++)
+ {
+ if (fun->parameters->variables[i].type.qualifier == slang_qual_inout ||
+ fun->parameters->variables[i].type.qualifier == slang_qual_out)
+ {
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ /* TODO: optimize the "out" parameter case */
+ if (!_slang_assemble_operation (A, ¶ms[i], slang_ref_force))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
+ if (!PUSH (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ if (i == 0 && assignment)
+ {
+ /* duplicate the resulting address */
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ }
+ if (!_slang_dereference (A, ¶ms[i]))
+ return GL_FALSE;
+ }
+ else
+ {
+ if (!_slang_assemble_operation (A, ¶ms[i], slang_ref_forbid))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
+ }
+ }
+
+ /* call the function */
+ if (!PLAB (A->file, slang_asm_call, fun->address))
+ return GL_FALSE;
+
+ /* pop the parameters from the stack */
+ for (i = param_count; i > 0; i--)
+ {
+ GLuint j = i - 1;
+
+ A->swz = p_swz[j];
+ A->ref = p_ref[j];
+ if (fun->parameters->variables[j].type.qualifier == slang_qual_inout ||
+ fun->parameters->variables[j].type.qualifier == slang_qual_out)
+ {
+ /* for output parameter copy the contents of the formal parameter
+ * back to the original actual parameter */
+ if (!_slang_assemble_assignment (A, ¶ms[j]))
+ return GL_FALSE;
+ /* pop the actual parameter's address */
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+ else
+ {
+ /* pop the value of the parameter */
+ if (!_slang_cleanup_stack (A, ¶ms[j]))
+ return GL_FALSE;
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *A, const char *name,
+ slang_operation *params, GLuint param_count, GLboolean assignment)
+{
+ slang_atom atom;
+ slang_function *fun;
+
+ atom = slang_atom_pool_atom (A->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+ fun = _slang_locate_function (A->space.funcs, atom, params, param_count, &A->space, A->atoms);
+ if (fun == NULL)
+ return GL_FALSE;
+ return _slang_assemble_function_call (A, fun, params, param_count, assignment);
+}
+
+static GLboolean assemble_function_call_name_dummyint (slang_assemble_ctx *A, const char *name,
+ slang_operation *params)
+{
+ slang_operation p[2];
+ GLboolean result;
+
+ p[0] = params[0];
+ if (!slang_operation_construct (&p[1]))
+ return GL_FALSE;
+ p[1].type = slang_oper_literal_int;
+ result = _slang_assemble_function_call_name (A, name, p, 2, GL_FALSE);
+ slang_operation_destruct (&p[1]);
+ return result;
+}
+
+static const struct
+{
+ const char *name;
+ slang_assembly_type code1, code2;
+} inst[] = {
+ /* core */
+ { "float_add", slang_asm_float_add, slang_asm_float_copy },
+ { "float_multiply", slang_asm_float_multiply, slang_asm_float_copy },
+ { "float_divide", slang_asm_float_divide, slang_asm_float_copy },
+ { "float_negate", slang_asm_float_negate, slang_asm_float_copy },
+ { "float_less", slang_asm_float_less, slang_asm_bool_copy },
+ { "float_equal", slang_asm_float_equal_exp,slang_asm_bool_copy },
+ { "float_to_int", slang_asm_float_to_int, slang_asm_int_copy },
+ { "float_sine", slang_asm_float_sine, slang_asm_float_copy },
+ { "float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy },
+ { "float_arctan", slang_asm_float_arctan, slang_asm_float_copy },
+ { "float_power", slang_asm_float_power, slang_asm_float_copy },
+ { "float_log2", slang_asm_float_log2, slang_asm_float_copy },
+ { "float_floor", slang_asm_float_floor, slang_asm_float_copy },
+ { "float_ceil", slang_asm_float_ceil, slang_asm_float_copy },
+ { "float_noise1", slang_asm_float_noise1, slang_asm_float_copy },
+ { "float_noise2", slang_asm_float_noise2, slang_asm_float_copy },
+ { "float_noise3", slang_asm_float_noise3, slang_asm_float_copy },
+ { "float_noise4", slang_asm_float_noise4, slang_asm_float_copy },
+ { "int_to_float", slang_asm_int_to_float, slang_asm_float_copy },
+ { "vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none },
+ { "vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none },
+ { "vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none },
+ { "vec4_texcube", slang_asm_vec4_texcube, slang_asm_none },
+ { "vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none },
+ { "vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none },
+ /* mesa-specific extensions */
+ { "float_print", slang_asm_float_deref, slang_asm_float_print },
+ { "int_print", slang_asm_int_deref, slang_asm_int_print },
+ { "bool_print", slang_asm_bool_deref, slang_asm_bool_print },
+ { NULL, slang_asm_none, slang_asm_none }
+};
+
+static GLboolean call_asm_instruction (slang_assemble_ctx *A, slang_atom a_name)
+{
+ const char *id;
+ GLuint i;
+
+ id = slang_atom_pool_id (A->atoms, a_name);
+
+ for (i = 0; inst[i].name != NULL; i++)
+ if (slang_string_compare (id, inst[i].name) == 0)
+ break;
+ if (inst[i].name == NULL)
+ return GL_FALSE;
+
+ if (!PLAB2 (A->file, inst[i].code1, 4, 0))
+ return GL_FALSE;
+ if (inst[i].code2 != slang_asm_none)
+ if (!PLAB2 (A->file, inst[i].code2, 4, 0))
+ return GL_FALSE;
+
+ /* clean-up the stack from the remaining dst address */
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+static GLboolean equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,
+ GLuint *index, GLuint size, GLuint z_label)
+{
+ GLuint i;
+
+ for (i = 0; i < agg->count; i++)
+ {
+ const slang_storage_array *arr = &agg->arrays[i];
+ GLuint j;
+
+ for (j = 0; j < arr->length; j++)
+ {
+ if (arr->type == slang_stor_aggregate)
+ {
+ if (!equality_aggregate (A, arr->aggregate, index, size, z_label))
+ return GL_FALSE;
+ }
+ else
+ {
+ if (!PLAB2 (A->file, slang_asm_float_equal_int, size + *index, *index))
+ return GL_FALSE;
+ *index += 4;
+ if (!PLAB (A->file, slang_asm_jump_if_zero, z_label))
+ return GL_FALSE;
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean equality (slang_assemble_ctx *A, slang_operation *op, GLboolean equal)
+{
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint index, size;
+ GLuint skip_jump, true_label, true_jump, false_label, false_jump;
+
+ /* get type of operation */
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ /* convert it to an aggregate */
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end;
+
+ /* compute the size of the agregate - there are two such aggregates on the stack */
+ size = _slang_sizeof_aggregate (&agg);
+
+ /* jump to the actual data-comparison code */
+ skip_jump = A->file->count;
+ if (!PUSH (A->file, slang_asm_jump))
+ goto end;
+
+ /* pop off the stack the compared data and push 1 */
+ true_label = A->file->count;
+ if (!PLAB (A->file, slang_asm_local_free, size * 2))
+ goto end;
+ if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 1))
+ goto end;
+ true_jump = A->file->count;
+ if (!PUSH (A->file, slang_asm_jump))
+ goto end;
+
+ false_label = A->file->count;
+ if (!PLAB (A->file, slang_asm_local_free, size * 2))
+ goto end;
+ if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 0))
+ goto end;
+ false_jump = A->file->count;
+ if (!PUSH (A->file, slang_asm_jump))
+ goto end;
+
+ A->file->code[skip_jump].param[0] = A->file->count;
+
+ /* compare the data on stack, it will eventually jump either to true or false label */
+ index = 0;
+ if (!equality_aggregate (A, &agg, &index, size, equal ? false_label : true_label))
+ goto end;
+ if (!PLAB (A->file, slang_asm_jump, equal ? true_label : false_label))
+ goto end;
+
+ A->file->code[true_jump].param[0] = A->file->count;
+ A->file->code[false_jump].param[0] = A->file->count;
+
+ result = GL_TRUE;
+end:
+ slang_storage_aggregate_destruct (&agg);
+end1:
+ slang_assembly_typeinfo_destruct (&ti);
+ return result;
+}
+
+static GLboolean handle_subscript (slang_assemble_ctx *A, slang_assembly_typeinfo *tie,
+ slang_assembly_typeinfo *tia, slang_operation *op, slang_ref_type ref)
+{
+ GLuint asize = 0, esize = 0;
+
+ /* get type info of the master expression (matrix, vector or an array */
+ if (!_slang_typeof_operation (A, &op->children[0], tia))
+ return GL_FALSE;
+ if (!sizeof_variable (A, &tia->spec, slang_qual_none, tia->array_len, &asize))
+ return GL_FALSE;
+
+ /* get type info of the result (matrix column, vector row or array element) */
+ if (!_slang_typeof_operation (A, op, tie))
+ return GL_FALSE;
+ if (!sizeof_variable (A, &tie->spec, slang_qual_none, 0, &esize))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation (A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* when indexing an l-value swizzle, push the swizzle_tmp */
+ if (ref == slang_ref_force && tia->is_swizzled)
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the subscript expression */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force && tia->is_swizzled)
+ {
+ GLuint i;
+
+ /* copy the swizzle indexes to the swizzle_tmp */
+ for (i = 0; i < tia->swz.num_components; i++)
+ {
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, i * 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, tia->swz.swizzle[i]))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+
+ /* offset the pushed swizzle_tmp address and dereference it */
+ if (!PUSH (A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ }
+ else
+ {
+ /* convert the integer subscript to a relative address */
+ if (!PUSH (A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ }
+
+ if (!PLAB (A->file, slang_asm_addr_push, esize))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force)
+ {
+ /* offset the base address with the relative address */
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ }
+ else
+ {
+ GLuint i;
+
+ /* move the selected element to the beginning of the master expression */
+ for (i = 0; i < esize; i += 4)
+ if (!PLAB2 (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+
+ /* free the rest of the master expression */
+ if (!PLAB (A->file, slang_asm_local_free, asize - esize))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean handle_field (slang_assemble_ctx *A, slang_assembly_typeinfo *tia,
+ slang_assembly_typeinfo *tib, slang_operation *op, slang_ref_type ref)
+{
+ /* get type info of the result (field or swizzle) */
+ if (!_slang_typeof_operation (A, op, tia))
+ return GL_FALSE;
+
+ /* get type info of the master expression being accessed (struct or vector) */
+ if (!_slang_typeof_operation (A, &op->children[0], tib))
+ return GL_FALSE;
+
+ /* if swizzling a vector in-place, the swizzle temporary is needed */
+ if (ref == slang_ref_forbid && tia->is_swizzled)
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation (A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* assemble the field expression */
+ if (tia->is_swizzled)
+ {
+ if (ref == slang_ref_force)
+ {
+#if 0
+ if (tia->swz.num_components == 1)
+ {
+ /* simple case - adjust the vector's address to point to the selected component */
+ if (!PLAB (file, slang_asm_addr_push, tia->swz.swizzle[0] * 4))
+ return 0;
+ if (!PUSH (file, slang_asm_addr_add))
+ return 0;
+ }
+ else
+#endif
+ {
+ /* two or more vector components are being referenced - the so-called write mask
+ * must be passed to the upper operations and applied when assigning value
+ * to this swizzle */
+ A->swz = tia->swz;
+ }
+ }
+ else
+ {
+ /* swizzle the vector in-place using the swizzle temporary */
+ if (!_slang_assemble_constructor_from_swizzle (A, &tia->swz, &tia->spec, &tib->spec))
+ return GL_FALSE;
+ }
+ }
+ else
+ {
+ GLuint i, struct_size = 0, field_offset = 0, field_size = 0;
+ GLboolean relocate, shrink;
+
+ /* calculate struct size, field offset and field size */
+ for (i = 0; i < tib->spec._struct->fields->num_variables; i++)
+ {
+ slang_variable *field;
+ slang_storage_aggregate agg;
+ GLuint size;
+
+ field = &tib->spec._struct->fields->variables[i];
+ if (!slang_storage_aggregate_construct (&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable (&agg, &field->type.specifier, field->array_len,
+ A->space.funcs, A->space.structs, A->space.vars, A->mach, A->file, A->atoms))
+ {
+ slang_storage_aggregate_destruct (&agg);
+ return GL_FALSE;
+ }
+ size = _slang_sizeof_aggregate (&agg);
+ slang_storage_aggregate_destruct (&agg);
+
+ if (op->a_id == field->a_name)
+ {
+ field_size = size;
+ struct_size = field_offset + size;
+ }
+ else if (struct_size != 0)
+ struct_size += size;
+ else
+ field_offset += size;
+ }
+
+ /*
+ * OPTIMIZATION: If selecting the last field, no relocation is needed.
+ */
+ relocate = field_offset != struct_size - field_size;
+
+ /*
+ * OPTIMIZATION: If field and struct sizes are equal, no partial free is needed.
+ */
+ shrink = field_size != struct_size;
+
+ if (relocate)
+ {
+ if (!PLAB (A->file, slang_asm_addr_push, field_offset))
+ return GL_FALSE;
+ }
+
+ if (ref == slang_ref_force)
+ {
+ if (relocate)
+ {
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ }
+ }
+ else
+ {
+ GLuint free_b = 0;
+
+ if (relocate)
+ {
+ GLuint i;
+
+ /*
+ * Move the selected element to the end of the master expression.
+ * Do it in reverse order to avoid overwriting itself.
+ */
+ for (i = field_size; i > 0; i -= 4)
+ if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i, i))
+ return GL_FALSE;
+ free_b += 4;
+ }
+
+ if (shrink)
+ {
+ /* free the rest of the master expression */
+ free_b += struct_size - field_size;
+ }
+
+ if (free_b)
+ {
+ if (!PLAB (A->file, slang_asm_local_free, free_b))
+ return GL_FALSE;
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean _slang_assemble_operation (slang_assemble_ctx *A, slang_operation *op, slang_ref_type ref)
+{
+ /* set default results */
+ A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ref;
+ A->swz.num_components = 0;
+
+ switch (op->type)
+ {
+ case slang_oper_block_no_new_scope:
+ case slang_oper_block_new_scope:
+ {
+ GLuint i;
+
+ for (i = 0; i < op->num_children; i++)
+ {
+ if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[i]))
+ return GL_FALSE;
+ }
+ }
+ break;
+ case slang_oper_variable_decl:
+ {
+ GLuint i;
+ slang_operation assign;
+ GLboolean result;
+
+ /* Construct assignment expression placeholder. */
+ if (!slang_operation_construct (&assign))
+ return GL_FALSE;
+ assign.type = slang_oper_assign;
+ assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
+ if (assign.children == NULL)
+ {
+ slang_operation_destruct (&assign);
+ return GL_FALSE;
+ }
+ for (assign.num_children = 0; assign.num_children < 2; assign.num_children++)
+ if (!slang_operation_construct (&assign.children[assign.num_children]))
+ {
+ slang_operation_destruct (&assign);
+ return GL_FALSE;
+ }
+
+ result = GL_TRUE;
+ for (i = 0; i < op->num_children; i++)
+ {
+ slang_variable *var;
+
+ var = _slang_locate_variable (op->children[i].locals, op->children[i].a_id, GL_TRUE);
+ if (var == NULL)
+ {
+ result = GL_FALSE;
+ break;
+ }
+ if (var->initializer == NULL)
+ continue;
+
+ if (!slang_operation_copy (&assign.children[0], &op->children[i]) ||
+ !slang_operation_copy (&assign.children[1], var->initializer) ||
+ !_slang_assemble_assign (A, &assign, "=", slang_ref_forbid) ||
+ !_slang_cleanup_stack (A, &assign))
+ {
+ result = GL_FALSE;
+ break;
+ }
+ }
+ slang_operation_destruct (&assign);
+ if (!result)
+ return GL_FALSE;
+ }
+ break;
+ case slang_oper_asm:
+ {
+ GLuint i;
+
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ for (i = 1; i < op->num_children; i++)
+ if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid))
+ return GL_FALSE;
+ if (!call_asm_instruction (A, op->a_id))
+ return GL_FALSE;
+ }
+ break;
+ case slang_oper_break:
+ if (!PLAB (A->file, slang_asm_jump, A->flow.loop_end))
+ return GL_FALSE;
+ break;
+ case slang_oper_continue:
+ if (!PLAB (A->file, slang_asm_jump, A->flow.loop_start))
+ return GL_FALSE;
+ break;
+ case slang_oper_discard:
+ if (!PUSH (A->file, slang_asm_discard))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_exit))
+ return GL_FALSE;
+ break;
+ case slang_oper_return:
+ if (A->local.ret_size != 0)
+ {
+ /* push the result's address */
+ if (!PLAB2 (A->file, slang_asm_local_addr, 0, A->local.ret_size))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ A->swz.num_components = 0;
+ /* assign the operation to the function result (it was reserved on the stack) */
+ if (!_slang_assemble_assignment (A, op->children))
+ return GL_FALSE;
+
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+ if (!PLAB (A->file, slang_asm_jump, A->flow.function_end))
+ return GL_FALSE;
+ break;
+ case slang_oper_expression:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[0], ref))
+ return GL_FALSE;
+ break;
+ case slang_oper_if:
+ if (!_slang_assemble_if (A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_while:
+ if (!_slang_assemble_while (A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_do:
+ if (!_slang_assemble_do (A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_for:
+ if (!_slang_assemble_for (A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_void:
+ break;
+ case slang_oper_literal_bool:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT (A->file, slang_asm_bool_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_literal_int:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT (A->file, slang_asm_int_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_literal_float:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT (A->file, slang_asm_float_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_identifier:
+ {
+ slang_variable *var;
+ GLuint size;
+
+ /* find the variable and calculate its size */
+ var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
+ if (var == NULL)
+ return GL_FALSE;
+ size = 0;
+ if (!sizeof_variable (A, &var->type.specifier, slang_qual_none, var->array_len, &size))
+ return GL_FALSE;
+
+ /* prepare stack for dereferencing */
+ if (ref == slang_ref_forbid)
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+
+ /* push the variable's address */
+ if (var->global)
+ {
+ if (!PLAB (A->file, slang_asm_global_addr, var->address))
+ return GL_FALSE;
+ }
+ else
+ {
+ if (!PLAB2 (A->file, slang_asm_local_addr, var->address, size))
+ return GL_FALSE;
+ }
+
+ /* perform the dereference */
+ if (ref == slang_ref_forbid)
+ {
+ if (!PUSH (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference (A, op))
+ return GL_FALSE;
+ }
+ }
+ break;
+ case slang_oper_sequence:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[0]))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_assign:
+ if (!_slang_assemble_assign (A, op, "=", ref))
+ return GL_FALSE;
+ break;
+ case slang_oper_addassign:
+ if (!_slang_assemble_assign (A, op, "+=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_subassign:
+ if (!_slang_assemble_assign (A, op, "-=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_mulassign:
+ if (!_slang_assemble_assign (A, op, "*=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ /*case slang_oper_modassign:*/
+ /*case slang_oper_lshassign:*/
+ /*case slang_oper_rshassign:*/
+ /*case slang_oper_orassign:*/
+ /*case slang_oper_xorassign:*/
+ /*case slang_oper_andassign:*/
+ case slang_oper_divassign:
+ if (!_slang_assemble_assign (A, op, "/=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_select:
+ if (!_slang_assemble_select (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicalor:
+ if (!_slang_assemble_logicalor (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicaland:
+ if (!_slang_assemble_logicaland (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicalxor:
+ if (!_slang_assemble_function_call_name (A, "^^", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_bitor:*/
+ /*case slang_oper_bitxor:*/
+ /*case slang_oper_bitand:*/
+ case slang_oper_less:
+ if (!_slang_assemble_function_call_name (A, "<", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_greater:
+ if (!_slang_assemble_function_call_name (A, ">", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_lessequal:
+ if (!_slang_assemble_function_call_name (A, "<=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_greaterequal:
+ if (!_slang_assemble_function_call_name (A, ">=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_lshift:*/
+ /*case slang_oper_rshift:*/
+ case slang_oper_add:
+ if (!_slang_assemble_function_call_name (A, "+", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_subtract:
+ if (!_slang_assemble_function_call_name (A, "-", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_multiply:
+ if (!_slang_assemble_function_call_name (A, "*", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_modulus:*/
+ case slang_oper_divide:
+ if (!_slang_assemble_function_call_name (A, "/", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_equal:
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality (A, op->children, GL_TRUE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_notequal:
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality (A, op->children, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_preincrement:
+ if (!_slang_assemble_assign (A, op, "++", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_predecrement:
+ if (!_slang_assemble_assign (A, op, "--", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_plus:
+ if (!_slang_dereference (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_minus:
+ if (!_slang_assemble_function_call_name (A, "-", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_complement:*/
+ case slang_oper_not:
+ if (!_slang_assemble_function_call_name (A, "!", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_subscript:
+ {
+ slang_assembly_typeinfo ti_arr, ti_elem;
+
+ if (!slang_assembly_typeinfo_construct (&ti_arr))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct (&ti_elem))
+ {
+ slang_assembly_typeinfo_destruct (&ti_arr);
+ return GL_FALSE;
+ }
+ if (!handle_subscript (A, &ti_elem, &ti_arr, op, ref))
+ {
+ slang_assembly_typeinfo_destruct (&ti_arr);
+ slang_assembly_typeinfo_destruct (&ti_elem);
+ return GL_FALSE;
+ }
+ slang_assembly_typeinfo_destruct (&ti_arr);
+ slang_assembly_typeinfo_destruct (&ti_elem);
+ }
+ break;
+ case slang_oper_call:
+ {
+ slang_function *fun;
+
+ fun = _slang_locate_function (A->space.funcs, op->a_id, op->children, op->num_children,
+ &A->space, A->atoms);
+ if (fun == NULL)
+ {
+ if (!_slang_assemble_constructor (A, op))
+ return GL_FALSE;
+ }
+ else
+ {
+ if (!_slang_assemble_function_call (A, fun, op->children, op->num_children, GL_FALSE))
+ return GL_FALSE;
+ }
+ A->ref = slang_ref_forbid;
+ }
+ break;
+ case slang_oper_field:
+ {
+ slang_assembly_typeinfo ti_after, ti_before;
+
+ if (!slang_assembly_typeinfo_construct (&ti_after))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct (&ti_before))
+ {
+ slang_assembly_typeinfo_destruct (&ti_after);
+ return GL_FALSE;
+ }
+ if (!handle_field (A, &ti_after, &ti_before, op, ref))
+ {
+ slang_assembly_typeinfo_destruct (&ti_after);
+ slang_assembly_typeinfo_destruct (&ti_before);
+ return GL_FALSE;
+ }
+ slang_assembly_typeinfo_destruct (&ti_after);
+ slang_assembly_typeinfo_destruct (&ti_before);
+ }
+ break;
+ case slang_oper_postincrement:
+ if (!assemble_function_call_name_dummyint (A, "++", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_postdecrement:
+ if (!assemble_function_call_name_dummyint (A, "--", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_ASSEMBLE_H\r
-#define SLANG_ASSEMBLE_H\r
-\r
-#include "slang_utility.h"\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-struct slang_operation_;\r
-\r
-typedef enum slang_assembly_type_\r
-{\r
- /* core */\r
- slang_asm_none,\r
- slang_asm_float_copy,\r
- slang_asm_float_move,\r
- slang_asm_float_push,\r
- slang_asm_float_deref,\r
- slang_asm_float_add,\r
- slang_asm_float_multiply,\r
- slang_asm_float_divide,\r
- slang_asm_float_negate,\r
- slang_asm_float_less,\r
- slang_asm_float_equal_exp,\r
- slang_asm_float_equal_int,\r
- slang_asm_float_to_int,\r
- slang_asm_float_sine,\r
- slang_asm_float_arcsine,\r
- slang_asm_float_arctan,\r
- slang_asm_float_power,\r
- slang_asm_float_log2,\r
- slang_asm_float_floor,\r
- slang_asm_float_ceil,\r
- slang_asm_float_noise1,\r
- slang_asm_float_noise2,\r
- slang_asm_float_noise3,\r
- slang_asm_float_noise4,\r
- slang_asm_int_copy,\r
- slang_asm_int_move,\r
- slang_asm_int_push,\r
- slang_asm_int_deref,\r
- slang_asm_int_to_float,\r
- slang_asm_int_to_addr,\r
- slang_asm_bool_copy,\r
- slang_asm_bool_move,\r
- slang_asm_bool_push,\r
- slang_asm_bool_deref,\r
- slang_asm_addr_copy,\r
- slang_asm_addr_push,\r
- slang_asm_addr_deref,\r
- slang_asm_addr_add,\r
- slang_asm_addr_multiply,\r
- slang_asm_vec4_tex1d,\r
- slang_asm_vec4_tex2d,\r
- slang_asm_vec4_tex3d,\r
- slang_asm_vec4_texcube,\r
- slang_asm_vec4_shad1d,\r
- slang_asm_vec4_shad2d,\r
- slang_asm_jump,\r
- slang_asm_jump_if_zero,\r
- slang_asm_enter,\r
- slang_asm_leave,\r
- slang_asm_local_alloc,\r
- slang_asm_local_free,\r
- slang_asm_local_addr,\r
- slang_asm_global_addr,\r
- slang_asm_call,\r
- slang_asm_return,\r
- slang_asm_discard,\r
- slang_asm_exit,\r
- /* mesa-specific extensions */\r
- slang_asm_float_print,\r
- slang_asm_int_print,\r
- slang_asm_bool_print,\r
- slang_asm__last\r
-} slang_assembly_type;\r
-\r
-typedef struct slang_assembly_\r
-{\r
- slang_assembly_type type;\r
- GLfloat literal;\r
- GLuint param[2];\r
-} slang_assembly;\r
-\r
-typedef struct slang_assembly_file_\r
-{\r
- slang_assembly *code;\r
- GLuint count;\r
- GLuint capacity;\r
-} slang_assembly_file;\r
-\r
-GLboolean slang_assembly_file_construct (slang_assembly_file *);\r
-GLvoid slang_assembly_file_destruct (slang_assembly_file *);\r
-GLboolean slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);\r
-GLboolean slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);\r
-GLboolean slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);\r
-GLboolean slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);\r
-\r
-typedef struct slang_assembly_file_restore_point_\r
-{\r
- GLuint count;\r
-} slang_assembly_file_restore_point;\r
-\r
-GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *,\r
- slang_assembly_file_restore_point *);\r
-GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *,\r
- slang_assembly_file_restore_point *);\r
-\r
-typedef struct slang_assembly_flow_control_\r
-{\r
- GLuint loop_start; /* for "continue" statement */\r
- GLuint loop_end; /* for "break" statement */\r
- GLuint function_end; /* for "return" statement */\r
-} slang_assembly_flow_control;\r
-\r
-typedef struct slang_assembly_local_info_\r
-{\r
- GLuint ret_size;\r
- GLuint addr_tmp;\r
- GLuint swizzle_tmp;\r
-} slang_assembly_local_info;\r
-\r
-typedef enum\r
-{\r
- slang_ref_force,\r
- slang_ref_forbid/*,\r
- slang_ref_freelance*/\r
-} slang_ref_type;\r
-\r
-/*\r
- * Holds a complete information about vector swizzle - the <swizzle> array contains\r
- * vector component source indices, where 0 is "x", 1 is "y", 2 is "z" and 3 is "w".\r
- * Example: "xwz" --> { 3, { 0, 3, 2, not used } }.\r
- */\r
-typedef struct slang_swizzle_\r
-{\r
- GLuint num_components;\r
- GLuint swizzle[4];\r
-} slang_swizzle;\r
-\r
-typedef struct slang_assembly_name_space_\r
-{\r
- struct slang_function_scope_ *funcs;\r
- struct slang_struct_scope_ *structs;\r
- struct slang_variable_scope_ *vars;\r
-} slang_assembly_name_space;\r
-\r
-typedef struct slang_assemble_ctx_\r
-{\r
- slang_assembly_file *file;\r
- struct slang_machine_ *mach;\r
- slang_atom_pool *atoms;\r
- slang_assembly_name_space space;\r
- slang_assembly_flow_control flow;\r
- slang_assembly_local_info local;\r
- slang_ref_type ref;\r
- slang_swizzle swz;\r
-} slang_assemble_ctx;\r
-\r
-struct slang_function_ *_slang_locate_function (struct slang_function_scope_ *funcs, slang_atom name,\r
- struct slang_operation_ *params, GLuint num_params, slang_assembly_name_space *space,\r
- slang_atom_pool *);\r
-\r
-GLboolean _slang_assemble_function (slang_assemble_ctx *, struct slang_function_ *);\r
-\r
-GLboolean _slang_cleanup_stack (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_dereference (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_function_call (slang_assemble_ctx *, struct slang_function_ *,\r
- struct slang_operation_ *, GLuint, GLboolean);\r
-\r
-GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *, const char *,\r
- struct slang_operation_ *, GLuint, GLboolean);\r
-\r
-GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operation_ *,\r
- slang_ref_type);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#include "slang_assemble_assignment.h"\r
-#include "slang_assemble_typeinfo.h"\r
-#include "slang_assemble_constructor.h"\r
-#include "slang_assemble_conditional.h"\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_ASSEMBLE_H
+#define SLANG_ASSEMBLE_H
+
+#include "slang_utility.h"
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+struct slang_operation_;
+
+typedef enum slang_assembly_type_
+{
+ /* core */
+ slang_asm_none,
+ slang_asm_float_copy,
+ slang_asm_float_move,
+ slang_asm_float_push,
+ slang_asm_float_deref,
+ slang_asm_float_add,
+ slang_asm_float_multiply,
+ slang_asm_float_divide,
+ slang_asm_float_negate,
+ slang_asm_float_less,
+ slang_asm_float_equal_exp,
+ slang_asm_float_equal_int,
+ slang_asm_float_to_int,
+ slang_asm_float_sine,
+ slang_asm_float_arcsine,
+ slang_asm_float_arctan,
+ slang_asm_float_power,
+ slang_asm_float_log2,
+ slang_asm_float_floor,
+ slang_asm_float_ceil,
+ slang_asm_float_noise1,
+ slang_asm_float_noise2,
+ slang_asm_float_noise3,
+ slang_asm_float_noise4,
+ slang_asm_int_copy,
+ slang_asm_int_move,
+ slang_asm_int_push,
+ slang_asm_int_deref,
+ slang_asm_int_to_float,
+ slang_asm_int_to_addr,
+ slang_asm_bool_copy,
+ slang_asm_bool_move,
+ slang_asm_bool_push,
+ slang_asm_bool_deref,
+ slang_asm_addr_copy,
+ slang_asm_addr_push,
+ slang_asm_addr_deref,
+ slang_asm_addr_add,
+ slang_asm_addr_multiply,
+ slang_asm_vec4_tex1d,
+ slang_asm_vec4_tex2d,
+ slang_asm_vec4_tex3d,
+ slang_asm_vec4_texcube,
+ slang_asm_vec4_shad1d,
+ slang_asm_vec4_shad2d,
+ slang_asm_jump,
+ slang_asm_jump_if_zero,
+ slang_asm_enter,
+ slang_asm_leave,
+ slang_asm_local_alloc,
+ slang_asm_local_free,
+ slang_asm_local_addr,
+ slang_asm_global_addr,
+ slang_asm_call,
+ slang_asm_return,
+ slang_asm_discard,
+ slang_asm_exit,
+ /* mesa-specific extensions */
+ slang_asm_float_print,
+ slang_asm_int_print,
+ slang_asm_bool_print,
+ slang_asm__last
+} slang_assembly_type;
+
+typedef struct slang_assembly_
+{
+ slang_assembly_type type;
+ GLfloat literal;
+ GLuint param[2];
+} slang_assembly;
+
+typedef struct slang_assembly_file_
+{
+ slang_assembly *code;
+ GLuint count;
+ GLuint capacity;
+} slang_assembly_file;
+
+GLboolean slang_assembly_file_construct (slang_assembly_file *);
+GLvoid slang_assembly_file_destruct (slang_assembly_file *);
+GLboolean slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);
+GLboolean slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);
+GLboolean slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);
+GLboolean slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);
+
+typedef struct slang_assembly_file_restore_point_
+{
+ GLuint count;
+} slang_assembly_file_restore_point;
+
+GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *,
+ slang_assembly_file_restore_point *);
+GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *,
+ slang_assembly_file_restore_point *);
+
+typedef struct slang_assembly_flow_control_
+{
+ GLuint loop_start; /* for "continue" statement */
+ GLuint loop_end; /* for "break" statement */
+ GLuint function_end; /* for "return" statement */
+} slang_assembly_flow_control;
+
+typedef struct slang_assembly_local_info_
+{
+ GLuint ret_size;
+ GLuint addr_tmp;
+ GLuint swizzle_tmp;
+} slang_assembly_local_info;
+
+typedef enum
+{
+ slang_ref_force,
+ slang_ref_forbid/*,
+ slang_ref_freelance*/
+} slang_ref_type;
+
+/*
+ * Holds a complete information about vector swizzle - the <swizzle> array contains
+ * vector component source indices, where 0 is "x", 1 is "y", 2 is "z" and 3 is "w".
+ * Example: "xwz" --> { 3, { 0, 3, 2, not used } }.
+ */
+typedef struct slang_swizzle_
+{
+ GLuint num_components;
+ GLuint swizzle[4];
+} slang_swizzle;
+
+typedef struct slang_assembly_name_space_
+{
+ struct slang_function_scope_ *funcs;
+ struct slang_struct_scope_ *structs;
+ struct slang_variable_scope_ *vars;
+} slang_assembly_name_space;
+
+typedef struct slang_assemble_ctx_
+{
+ slang_assembly_file *file;
+ struct slang_machine_ *mach;
+ slang_atom_pool *atoms;
+ slang_assembly_name_space space;
+ slang_assembly_flow_control flow;
+ slang_assembly_local_info local;
+ slang_ref_type ref;
+ slang_swizzle swz;
+} slang_assemble_ctx;
+
+struct slang_function_ *_slang_locate_function (struct slang_function_scope_ *funcs, slang_atom name,
+ struct slang_operation_ *params, GLuint num_params, slang_assembly_name_space *space,
+ slang_atom_pool *);
+
+GLboolean _slang_assemble_function (slang_assemble_ctx *, struct slang_function_ *);
+
+GLboolean _slang_cleanup_stack (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_dereference (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_function_call (slang_assemble_ctx *, struct slang_function_ *,
+ struct slang_operation_ *, GLuint, GLboolean);
+
+GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *, const char *,
+ struct slang_operation_ *, GLuint, GLboolean);
+
+GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operation_ *,
+ slang_ref_type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#include "slang_assemble_assignment.h"
+#include "slang_assemble_typeinfo.h"
+#include "slang_assemble_constructor.h"
+#include "slang_assemble_conditional.h"
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_assemble_assignment.c\r
- * slang assignment expressions assembler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_assemble.h"\r
-#include "slang_storage.h"\r
-\r
-/*\r
- * _slang_assemble_assignment()\r
- *\r
- * Copies values on the stack (<component 0> to <component N-1>) to a memory\r
- * location pointed by <addr of variable>.\r
- *\r
- * in:\r
- * +------------------+\r
- * | addr of variable |\r
- * +------------------+\r
- * | component N-1 |\r
- * | ... |\r
- * | component 0 |\r
- * +------------------+\r
- *\r
- * out:\r
- * +------------------+\r
- * | addr of variable |\r
- * +------------------+\r
- */\r
-\r
-static GLboolean assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,\r
- GLuint *index, GLuint size)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < agg->count; i++)\r
- {\r
- const slang_storage_array *arr = &agg->arrays[i];\r
- GLuint j;\r
-\r
- for (j = 0; j < arr->length; j++)\r
- {\r
- if (arr->type == slang_stor_aggregate)\r
- {\r
- if (!assign_aggregate (A, arr->aggregate, index, size))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- GLuint dst_addr_loc, dst_offset;\r
- slang_assembly_type ty;\r
-\r
- /* calculate the distance from top of the stack to the destination address */\r
- dst_addr_loc = size - *index;\r
-\r
- /* calculate the offset within destination variable to write */\r
- if (A->swz.num_components != 0)\r
- {\r
- /* swizzle the index to get the actual offset */\r
- dst_offset = A->swz.swizzle[*index / 4] * 4;\r
- }\r
- else\r
- {\r
- /* no swizzling - write sequentially */\r
- dst_offset = *index;\r
- }\r
-\r
- switch (arr->type)\r
- {\r
- case slang_stor_bool:\r
- ty = slang_asm_bool_copy;\r
- break;\r
- case slang_stor_int:\r
- ty = slang_asm_int_copy;\r
- break;\r
- case slang_stor_float:\r
- ty = slang_asm_float_copy;\r
- break;\r
- default:\r
- break;\r
- }\r
- if (!slang_assembly_file_push_label2 (A->file, ty, dst_addr_loc, dst_offset))\r
- return GL_FALSE;\r
-\r
- *index += 4;\r
- }\r
- }\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean _slang_assemble_assignment (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- slang_assembly_typeinfo ti;\r
- GLboolean result = GL_FALSE;\r
- slang_storage_aggregate agg;\r
- GLuint index, size;\r
-\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation (A, op, &ti))\r
- goto end1;\r
-\r
- if (!slang_storage_aggregate_construct (&agg))\r
- goto end1;\r
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,\r
- A->space.vars, A->mach, A->file, A->atoms))\r
- goto end;\r
-\r
- index = 0;\r
- size = _slang_sizeof_aggregate (&agg);\r
- result = assign_aggregate (A, &agg, &index, size);\r
-\r
-end1:\r
- slang_storage_aggregate_destruct (&agg);\r
-end:\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return result;\r
-}\r
-\r
-/*\r
- * _slang_assemble_assign()\r
- *\r
- * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) assignment on the operation's\r
- * children.\r
- */\r
-\r
-GLboolean _slang_assemble_assign (slang_assemble_ctx *A, slang_operation *op, const char *oper,\r
- slang_ref_type ref)\r
-{\r
- slang_swizzle swz;\r
-\r
- if (ref == slang_ref_forbid)\r
- {\r
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))\r
- return GL_FALSE;\r
- }\r
-\r
- if (slang_string_compare ("=", oper) == 0)\r
- {\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))\r
- return GL_FALSE;\r
- swz = A->swz;\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
- A->swz = swz;\r
- if (!_slang_assemble_assignment (A, op->children))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- if (!_slang_assemble_function_call_name (A, oper, op->children, op->num_children, GL_TRUE))\r
- return GL_FALSE;\r
- }\r
-\r
- if (ref == slang_ref_forbid)\r
- {\r
- if (!slang_assembly_file_push (A->file, slang_asm_addr_copy))\r
- return GL_FALSE;\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
- if (!_slang_dereference (A, op->children))\r
- return GL_FALSE;\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_assemble_assignment.c
+ * slang assignment expressions assembler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_assemble.h"
+#include "slang_storage.h"
+
+/*
+ * _slang_assemble_assignment()
+ *
+ * Copies values on the stack (<component 0> to <component N-1>) to a memory
+ * location pointed by <addr of variable>.
+ *
+ * in:
+ * +------------------+
+ * | addr of variable |
+ * +------------------+
+ * | component N-1 |
+ * | ... |
+ * | component 0 |
+ * +------------------+
+ *
+ * out:
+ * +------------------+
+ * | addr of variable |
+ * +------------------+
+ */
+
+static GLboolean assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,
+ GLuint *index, GLuint size)
+{
+ GLuint i;
+
+ for (i = 0; i < agg->count; i++)
+ {
+ const slang_storage_array *arr = &agg->arrays[i];
+ GLuint j;
+
+ for (j = 0; j < arr->length; j++)
+ {
+ if (arr->type == slang_stor_aggregate)
+ {
+ if (!assign_aggregate (A, arr->aggregate, index, size))
+ return GL_FALSE;
+ }
+ else
+ {
+ GLuint dst_addr_loc, dst_offset;
+ slang_assembly_type ty;
+
+ /* calculate the distance from top of the stack to the destination address */
+ dst_addr_loc = size - *index;
+
+ /* calculate the offset within destination variable to write */
+ if (A->swz.num_components != 0)
+ {
+ /* swizzle the index to get the actual offset */
+ dst_offset = A->swz.swizzle[*index / 4] * 4;
+ }
+ else
+ {
+ /* no swizzling - write sequentially */
+ dst_offset = *index;
+ }
+
+ switch (arr->type)
+ {
+ case slang_stor_bool:
+ ty = slang_asm_bool_copy;
+ break;
+ case slang_stor_int:
+ ty = slang_asm_int_copy;
+ break;
+ case slang_stor_float:
+ ty = slang_asm_float_copy;
+ break;
+ default:
+ break;
+ }
+ if (!slang_assembly_file_push_label2 (A->file, ty, dst_addr_loc, dst_offset))
+ return GL_FALSE;
+
+ *index += 4;
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean _slang_assemble_assignment (slang_assemble_ctx *A, slang_operation *op)
+{
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint index, size;
+
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end;
+
+ index = 0;
+ size = _slang_sizeof_aggregate (&agg);
+ result = assign_aggregate (A, &agg, &index, size);
+
+end1:
+ slang_storage_aggregate_destruct (&agg);
+end:
+ slang_assembly_typeinfo_destruct (&ti);
+ return result;
+}
+
+/*
+ * _slang_assemble_assign()
+ *
+ * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) assignment on the operation's
+ * children.
+ */
+
+GLboolean _slang_assemble_assign (slang_assemble_ctx *A, slang_operation *op, const char *oper,
+ slang_ref_type ref)
+{
+ slang_swizzle swz;
+
+ if (ref == slang_ref_forbid)
+ {
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ }
+
+ if (slang_string_compare ("=", oper) == 0)
+ {
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ swz = A->swz;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->swz = swz;
+ if (!_slang_assemble_assignment (A, op->children))
+ return GL_FALSE;
+ }
+ else
+ {
+ if (!_slang_assemble_function_call_name (A, oper, op->children, op->num_children, GL_TRUE))
+ return GL_FALSE;
+ }
+
+ if (ref == slang_ref_forbid)
+ {
+ if (!slang_assembly_file_push (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference (A, op->children))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H\r
-#define SLANG_ASSEMBLE_ASSIGNMENT_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-GLboolean _slang_assemble_assignment (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_assign (slang_assemble_ctx *, struct slang_operation_ *, const char *,\r
- slang_ref_type);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H
+#define SLANG_ASSEMBLE_ASSIGNMENT_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+GLboolean _slang_assemble_assignment (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_assign (slang_assemble_ctx *, struct slang_operation_ *, const char *,
+ slang_ref_type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_assemble_conditional.c\r
- * slang condtional expressions assembler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_assemble.h"\r
-#include "slang_compile.h"\r
-\r
-/*\r
- * _slang_assemble_logicaland()\r
- *\r
- * and:\r
- * <left-expression>\r
- * jumpz zero\r
- * <right-expression>\r
- * jump end\r
- * zero:\r
- * push 0\r
- * end:\r
- */\r
-\r
-GLboolean _slang_assemble_logicaland (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- GLuint zero_jump, end_jump;\r
-\r
- /* evaluate left expression */\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to pushing 0 if not true */\r
- zero_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))\r
- return GL_FALSE;\r
-\r
- /* evaluate right expression */\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to the end of the expression */\r
- end_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* push 0 on stack */\r
- A->file->code[zero_jump].param[0] = A->file->count;\r
- if (!slang_assembly_file_push_literal (A->file, slang_asm_bool_push, (GLfloat) 0))\r
- return GL_FALSE;\r
-\r
- /* the end of the expression */\r
- A->file->code[end_jump].param[0] = A->file->count;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/*\r
- * _slang_assemble_logicalor()\r
- *\r
- * or:\r
- * <left-expression>\r
- * jumpz right\r
- * push 1\r
- * jump end\r
- * right:\r
- * <right-expression>\r
- * end:\r
- */\r
-\r
-GLboolean _slang_assemble_logicalor (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- GLuint right_jump, end_jump;\r
-\r
- /* evaluate left expression */\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to evaluation of right expression if not true */\r
- right_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))\r
- return GL_FALSE;\r
-\r
- /* push 1 on stack */\r
- if (!slang_assembly_file_push_literal (A->file, slang_asm_bool_push, (GLfloat) 1))\r
- return GL_FALSE;\r
-\r
- /* jump to the end of the expression */\r
- end_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* evaluate right expression */\r
- A->file->code[right_jump].param[0] = A->file->count;\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* the end of the expression */\r
- A->file->code[end_jump].param[0] = A->file->count;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/*\r
- * _slang_assemble_select()\r
- *\r
- * select:\r
- * <condition-expression>\r
- * jumpz false\r
- * <true-expression>\r
- * jump end\r
- * false:\r
- * <false-expression>\r
- * end:\r
- */\r
-\r
-GLboolean _slang_assemble_select (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- GLuint cond_jump, end_jump;\r
-\r
- /* execute condition expression */\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to false expression if not true */\r
- cond_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))\r
- return GL_FALSE;\r
-\r
- /* execute true expression */\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to the end of the expression */\r
- end_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* resolve false point */\r
- A->file->code[cond_jump].param[0] = A->file->count;\r
-\r
- /* execute false expression */\r
- if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* resolve the end of the expression */\r
- A->file->code[end_jump].param[0] = A->file->count;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/*\r
- * _slang_assemble_for()\r
- *\r
- * for:\r
- * <init-statement>\r
- * jump start\r
- * break:\r
- * jump end\r
- * continue:\r
- * <loop-increment>\r
- * start:\r
- * <condition-statement>\r
- * jumpz end\r
- * <loop-body>\r
- * jump continue\r
- * end:\r
- */\r
-\r
-GLboolean _slang_assemble_for (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- GLuint start_jump, end_jump, cond_jump;\r
- GLuint break_label, cont_label;\r
- slang_assembly_flow_control save_flow = A->flow;\r
-\r
- /* execute initialization statement */\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[0]))\r
- return GL_FALSE;\r
-\r
- /* skip the "go to the end of the loop" and loop-increment statements */\r
- start_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* go to the end of the loop - break statements are directed here */\r
- break_label = A->file->count;\r
- end_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* resolve the beginning of the loop - continue statements are directed here */\r
- cont_label = A->file->count;\r
-\r
- /* execute loop-increment statement */\r
- if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[2]))\r
- return GL_FALSE;\r
-\r
- /* resolve the condition point */\r
- A->file->code[start_jump].param[0] = A->file->count;\r
-\r
- /* execute condition statement */\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to the end of the loop if not true */\r
- cond_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))\r
- return GL_FALSE;\r
-\r
- /* execute loop body */\r
- A->flow.loop_start = cont_label;\r
- A->flow.loop_end = break_label;\r
- if (!_slang_assemble_operation (A, &op->children[3], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[3]))\r
- return GL_FALSE;\r
- A->flow = save_flow;\r
-\r
- /* go to the beginning of the loop */\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_jump, cont_label))\r
- return GL_FALSE;\r
-\r
- /* resolve the end of the loop */\r
- A->file->code[end_jump].param[0] = A->file->count;\r
- A->file->code[cond_jump].param[0] = A->file->count;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/*\r
- * _slang_assemble_do()\r
- *\r
- * do:\r
- * jump start\r
- * break:\r
- * jump end\r
- * continue:\r
- * jump condition\r
- * start:\r
- * <loop-body>\r
- * condition:\r
- * <condition-statement>\r
- * jumpz end\r
- * jump start\r
- * end:\r
- */\r
-\r
-GLboolean _slang_assemble_do (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- GLuint skip_jump, end_jump, cont_jump, cond_jump;\r
- GLuint break_label, cont_label;\r
- slang_assembly_flow_control save_flow = A->flow;\r
-\r
- /* skip the "go to the end of the loop" and "go to condition" statements */\r
- skip_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* go to the end of the loop - break statements are directed here */\r
- break_label = A->file->count;\r
- end_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* go to condition - continue statements are directed here */\r
- cont_label = A->file->count;\r
- cont_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* resolve the beginning of the loop */\r
- A->file->code[skip_jump].param[0] = A->file->count;\r
-\r
- /* execute loop body */\r
- A->flow.loop_start = cont_label;\r
- A->flow.loop_end = break_label;\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[0]))\r
- return GL_FALSE;\r
- A->flow = save_flow;\r
-\r
- /* resolve condition point */\r
- A->file->code[cont_jump].param[0] = A->file->count;\r
-\r
- /* execute condition statement */\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to the end of the loop if not true */\r
- cond_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))\r
- return GL_FALSE;\r
-\r
- /* jump to the beginning of the loop */\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_jump, A->file->code[skip_jump].param[0]))\r
- return GL_FALSE;\r
-\r
- /* resolve the end of the loop */\r
- A->file->code[end_jump].param[0] = A->file->count;\r
- A->file->code[cond_jump].param[0] = A->file->count;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/*\r
- * _slang_assemble_while()\r
- *\r
- * while:\r
- * jump continue\r
- * break:\r
- * jump end\r
- * continue:\r
- * <condition-statement>\r
- * jumpz end\r
- * <loop-body>\r
- * jump continue\r
- * end:\r
- */\r
-\r
-GLboolean _slang_assemble_while (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- GLuint skip_jump, end_jump, cond_jump;\r
- GLuint break_label;\r
- slang_assembly_flow_control save_flow = A->flow;\r
-\r
- /* skip the "go to the end of the loop" statement */\r
- skip_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* go to the end of the loop - break statements are directed here */\r
- break_label = A->file->count;\r
- end_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* resolve the beginning of the loop - continue statements are directed here */\r
- A->file->code[skip_jump].param[0] = A->file->count;\r
-\r
- /* execute condition statement */\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to the end of the loop if not true */\r
- cond_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))\r
- return GL_FALSE;\r
-\r
- /* execute loop body */\r
- A->flow.loop_start = A->file->code[skip_jump].param[0];\r
- A->flow.loop_end = break_label;\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[1]))\r
- return GL_FALSE;\r
- A->flow = save_flow;\r
-\r
- /* jump to the beginning of the loop */\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_jump, A->file->code[skip_jump].param[0]))\r
- return GL_FALSE;\r
-\r
- /* resolve the end of the loop */\r
- A->file->code[end_jump].param[0] = A->file->count;\r
- A->file->code[cond_jump].param[0] = A->file->count;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/*\r
- * _slang_assemble_if()\r
- *\r
- * if:\r
- * <condition-statement>\r
- * jumpz else\r
- * <true-statement>\r
- * jump end\r
- * else:\r
- * <false-statement>\r
- * end:\r
- */\r
-\r
-GLboolean _slang_assemble_if (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- GLuint cond_jump, else_jump;\r
-\r
- /* execute condition statement */\r
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))\r
- return GL_FALSE;\r
-\r
- /* jump to false-statement if not true */\r
- cond_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))\r
- return GL_FALSE;\r
-\r
- /* execute true-statement */\r
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[1]))\r
- return GL_FALSE;\r
-\r
- /* skip if-false statement */\r
- else_jump = A->file->count;\r
- if (!slang_assembly_file_push (A->file, slang_asm_jump))\r
- return GL_FALSE;\r
-\r
- /* resolve start of false-statement */\r
- A->file->code[cond_jump].param[0] = A->file->count;\r
-\r
- /* execute false-statement */\r
- if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid/*slang_ref_freelance*/))\r
- return GL_FALSE;\r
- if (!_slang_cleanup_stack (A, &op->children[2]))\r
- return GL_FALSE;\r
-\r
- /* resolve end of if-false statement */\r
- A->file->code[else_jump].param[0] = A->file->count;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_assemble_conditional.c
+ * slang condtional expressions assembler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_assemble.h"
+#include "slang_compile.h"
+
+/*
+ * _slang_assemble_logicaland()
+ *
+ * and:
+ * <left-expression>
+ * jumpz zero
+ * <right-expression>
+ * jump end
+ * zero:
+ * push 0
+ * end:
+ */
+
+GLboolean _slang_assemble_logicaland (slang_assemble_ctx *A, slang_operation *op)
+{
+ GLuint zero_jump, end_jump;
+
+ /* evaluate left expression */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to pushing 0 if not true */
+ zero_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
+
+ /* evaluate right expression */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to the end of the expression */
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* push 0 on stack */
+ A->file->code[zero_jump].param[0] = A->file->count;
+ if (!slang_assembly_file_push_literal (A->file, slang_asm_bool_push, (GLfloat) 0))
+ return GL_FALSE;
+
+ /* the end of the expression */
+ A->file->code[end_jump].param[0] = A->file->count;
+
+ return GL_TRUE;
+}
+
+/*
+ * _slang_assemble_logicalor()
+ *
+ * or:
+ * <left-expression>
+ * jumpz right
+ * push 1
+ * jump end
+ * right:
+ * <right-expression>
+ * end:
+ */
+
+GLboolean _slang_assemble_logicalor (slang_assemble_ctx *A, slang_operation *op)
+{
+ GLuint right_jump, end_jump;
+
+ /* evaluate left expression */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to evaluation of right expression if not true */
+ right_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
+
+ /* push 1 on stack */
+ if (!slang_assembly_file_push_literal (A->file, slang_asm_bool_push, (GLfloat) 1))
+ return GL_FALSE;
+
+ /* jump to the end of the expression */
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* evaluate right expression */
+ A->file->code[right_jump].param[0] = A->file->count;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* the end of the expression */
+ A->file->code[end_jump].param[0] = A->file->count;
+
+ return GL_TRUE;
+}
+
+/*
+ * _slang_assemble_select()
+ *
+ * select:
+ * <condition-expression>
+ * jumpz false
+ * <true-expression>
+ * jump end
+ * false:
+ * <false-expression>
+ * end:
+ */
+
+GLboolean _slang_assemble_select (slang_assemble_ctx *A, slang_operation *op)
+{
+ GLuint cond_jump, end_jump;
+
+ /* execute condition expression */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to false expression if not true */
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
+
+ /* execute true expression */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to the end of the expression */
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* resolve false point */
+ A->file->code[cond_jump].param[0] = A->file->count;
+
+ /* execute false expression */
+ if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* resolve the end of the expression */
+ A->file->code[end_jump].param[0] = A->file->count;
+
+ return GL_TRUE;
+}
+
+/*
+ * _slang_assemble_for()
+ *
+ * for:
+ * <init-statement>
+ * jump start
+ * break:
+ * jump end
+ * continue:
+ * <loop-increment>
+ * start:
+ * <condition-statement>
+ * jumpz end
+ * <loop-body>
+ * jump continue
+ * end:
+ */
+
+GLboolean _slang_assemble_for (slang_assemble_ctx *A, slang_operation *op)
+{
+ GLuint start_jump, end_jump, cond_jump;
+ GLuint break_label, cont_label;
+ slang_assembly_flow_control save_flow = A->flow;
+
+ /* execute initialization statement */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[0]))
+ return GL_FALSE;
+
+ /* skip the "go to the end of the loop" and loop-increment statements */
+ start_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* go to the end of the loop - break statements are directed here */
+ break_label = A->file->count;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* resolve the beginning of the loop - continue statements are directed here */
+ cont_label = A->file->count;
+
+ /* execute loop-increment statement */
+ if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[2]))
+ return GL_FALSE;
+
+ /* resolve the condition point */
+ A->file->code[start_jump].param[0] = A->file->count;
+
+ /* execute condition statement */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to the end of the loop if not true */
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
+
+ /* execute loop body */
+ A->flow.loop_start = cont_label;
+ A->flow.loop_end = break_label;
+ if (!_slang_assemble_operation (A, &op->children[3], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[3]))
+ return GL_FALSE;
+ A->flow = save_flow;
+
+ /* go to the beginning of the loop */
+ if (!slang_assembly_file_push_label (A->file, slang_asm_jump, cont_label))
+ return GL_FALSE;
+
+ /* resolve the end of the loop */
+ A->file->code[end_jump].param[0] = A->file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
+
+ return GL_TRUE;
+}
+
+/*
+ * _slang_assemble_do()
+ *
+ * do:
+ * jump start
+ * break:
+ * jump end
+ * continue:
+ * jump condition
+ * start:
+ * <loop-body>
+ * condition:
+ * <condition-statement>
+ * jumpz end
+ * jump start
+ * end:
+ */
+
+GLboolean _slang_assemble_do (slang_assemble_ctx *A, slang_operation *op)
+{
+ GLuint skip_jump, end_jump, cont_jump, cond_jump;
+ GLuint break_label, cont_label;
+ slang_assembly_flow_control save_flow = A->flow;
+
+ /* skip the "go to the end of the loop" and "go to condition" statements */
+ skip_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* go to the end of the loop - break statements are directed here */
+ break_label = A->file->count;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* go to condition - continue statements are directed here */
+ cont_label = A->file->count;
+ cont_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* resolve the beginning of the loop */
+ A->file->code[skip_jump].param[0] = A->file->count;
+
+ /* execute loop body */
+ A->flow.loop_start = cont_label;
+ A->flow.loop_end = break_label;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[0]))
+ return GL_FALSE;
+ A->flow = save_flow;
+
+ /* resolve condition point */
+ A->file->code[cont_jump].param[0] = A->file->count;
+
+ /* execute condition statement */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to the end of the loop if not true */
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
+
+ /* jump to the beginning of the loop */
+ if (!slang_assembly_file_push_label (A->file, slang_asm_jump, A->file->code[skip_jump].param[0]))
+ return GL_FALSE;
+
+ /* resolve the end of the loop */
+ A->file->code[end_jump].param[0] = A->file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
+
+ return GL_TRUE;
+}
+
+/*
+ * _slang_assemble_while()
+ *
+ * while:
+ * jump continue
+ * break:
+ * jump end
+ * continue:
+ * <condition-statement>
+ * jumpz end
+ * <loop-body>
+ * jump continue
+ * end:
+ */
+
+GLboolean _slang_assemble_while (slang_assemble_ctx *A, slang_operation *op)
+{
+ GLuint skip_jump, end_jump, cond_jump;
+ GLuint break_label;
+ slang_assembly_flow_control save_flow = A->flow;
+
+ /* skip the "go to the end of the loop" statement */
+ skip_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* go to the end of the loop - break statements are directed here */
+ break_label = A->file->count;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* resolve the beginning of the loop - continue statements are directed here */
+ A->file->code[skip_jump].param[0] = A->file->count;
+
+ /* execute condition statement */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to the end of the loop if not true */
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
+
+ /* execute loop body */
+ A->flow.loop_start = A->file->code[skip_jump].param[0];
+ A->flow.loop_end = break_label;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[1]))
+ return GL_FALSE;
+ A->flow = save_flow;
+
+ /* jump to the beginning of the loop */
+ if (!slang_assembly_file_push_label (A->file, slang_asm_jump, A->file->code[skip_jump].param[0]))
+ return GL_FALSE;
+
+ /* resolve the end of the loop */
+ A->file->code[end_jump].param[0] = A->file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
+
+ return GL_TRUE;
+}
+
+/*
+ * _slang_assemble_if()
+ *
+ * if:
+ * <condition-statement>
+ * jumpz else
+ * <true-statement>
+ * jump end
+ * else:
+ * <false-statement>
+ * end:
+ */
+
+GLboolean _slang_assemble_if (slang_assemble_ctx *A, slang_operation *op)
+{
+ GLuint cond_jump, else_jump;
+
+ /* execute condition statement */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ /* jump to false-statement if not true */
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
+
+ /* execute true-statement */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[1]))
+ return GL_FALSE;
+
+ /* skip if-false statement */
+ else_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
+
+ /* resolve start of false-statement */
+ A->file->code[cond_jump].param[0] = A->file->count;
+
+ /* execute false-statement */
+ if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[2]))
+ return GL_FALSE;
+
+ /* resolve end of if-false statement */
+ A->file->code[else_jump].param[0] = A->file->count;
+
+ return GL_TRUE;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_ASSEMBLE_CONDITIONAL_H\r
-#define SLANG_ASSEMBLE_CONDITIONAL_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-GLboolean _slang_assemble_logicaland (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_logicalor (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_select (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_for (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_do (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_while (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_if (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_ASSEMBLE_CONDITIONAL_H
+#define SLANG_ASSEMBLE_CONDITIONAL_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+GLboolean _slang_assemble_logicaland (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_logicalor (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_select (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_for (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_do (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_while (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_if (slang_assemble_ctx *, struct slang_operation_ *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_assemble_constructor.c\r
- * slang constructor and vector swizzle assembler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_assemble.h"\r
-#include "slang_storage.h"\r
-\r
-/* _slang_is_swizzle() */\r
-\r
-GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz)\r
-{\r
- GLuint i;\r
- GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE;\r
-\r
- /* the swizzle can be at most 4-component long */\r
- swz->num_components = slang_string_length (field);\r
- if (swz->num_components > 4)\r
- return GL_FALSE;\r
-\r
- for (i = 0; i < swz->num_components; i++)\r
- {\r
- /* mark which swizzle group is used */\r
- switch (field[i])\r
- {\r
- case 'x':\r
- case 'y':\r
- case 'z':\r
- case 'w':\r
- xyzw = GL_TRUE;\r
- break;\r
- case 'r':\r
- case 'g':\r
- case 'b':\r
- case 'a':\r
- rgba = GL_TRUE;\r
- break;\r
- case 's':\r
- case 't':\r
- case 'p':\r
- case 'q':\r
- stpq = GL_TRUE;\r
- break;\r
- default:\r
- return GL_FALSE;\r
- }\r
-\r
- /* collect swizzle component */\r
- switch (field[i])\r
- {\r
- case 'x':\r
- case 'r':\r
- case 's':\r
- swz->swizzle[i] = 0;\r
- break;\r
- case 'y':\r
- case 'g':\r
- case 't':\r
- swz->swizzle[i] = 1;\r
- break;\r
- case 'z':\r
- case 'b':\r
- case 'p':\r
- swz->swizzle[i] = 2;\r
- break;\r
- case 'w':\r
- case 'a':\r
- case 'q':\r
- swz->swizzle[i] = 3;\r
- break;\r
- }\r
-\r
- /* check if the component is valid for given vector's row count */\r
- if (rows <= swz->swizzle[i])\r
- return GL_FALSE;\r
- }\r
-\r
- /* only one swizzle group can be used */\r
- if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq))\r
- return GL_FALSE;\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/* _slang_is_swizzle_mask() */\r
-\r
-GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows)\r
-{\r
- GLuint i, c = 0;\r
-\r
- /* the swizzle may not be longer than the vector dim */\r
- if (swz->num_components > rows)\r
- return GL_FALSE;\r
-\r
- /* the swizzle components cannot be duplicated */\r
- for (i = 0; i < swz->num_components; i++)\r
- {\r
- if ((c & (1 << swz->swizzle[i])) != 0)\r
- return GL_FALSE;\r
- c |= 1 << swz->swizzle[i];\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/* _slang_multiply_swizzles() */\r
-\r
-GLvoid _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left,\r
- const slang_swizzle *right)\r
-{\r
- GLuint i;\r
-\r
- dst->num_components = right->num_components;\r
- for (i = 0; i < right->num_components; i++)\r
- dst->swizzle[i] = left->swizzle[right->swizzle[i]];\r
-}\r
-\r
-/* _slang_assemble_constructor() */\r
-\r
-static GLboolean sizeof_argument (slang_assemble_ctx *A, GLuint *size, slang_operation *op)\r
-{\r
- slang_assembly_typeinfo ti;\r
- GLboolean result = GL_FALSE;\r
- slang_storage_aggregate agg, flat_agg;\r
-\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation (A, op, &ti))\r
- goto end1;\r
-\r
- if (!slang_storage_aggregate_construct (&agg))\r
- goto end1;\r
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,\r
- A->space.vars, A->mach, A->file, A->atoms))\r
- goto end2;\r
-\r
- if (!slang_storage_aggregate_construct (&flat_agg))\r
- goto end2;\r
- if (!_slang_flatten_aggregate (&flat_agg, &agg))\r
- goto end;\r
-\r
- *size = flat_agg.count * 4;\r
-\r
- result = GL_TRUE;\r
-end:\r
- slang_storage_aggregate_destruct (&flat_agg);\r
-end2:\r
- slang_storage_aggregate_destruct (&agg);\r
-end1:\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return result;\r
-}\r
-\r
-static GLboolean constructor_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *flat,\r
- slang_operation *op, GLuint garbage_size)\r
-{\r
- slang_assembly_typeinfo ti;\r
- GLboolean result = GL_FALSE;\r
- slang_storage_aggregate agg, flat_agg;\r
-\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation (A, op, &ti))\r
- goto end1;\r
-\r
- if (!slang_storage_aggregate_construct (&agg))\r
- goto end1;\r
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,\r
- A->space.vars, A->mach, A->file, A->atoms))\r
- goto end2;\r
-\r
- if (!slang_storage_aggregate_construct (&flat_agg))\r
- goto end2;\r
- if (!_slang_flatten_aggregate (&flat_agg, &agg))\r
- goto end;\r
-\r
- if (!_slang_assemble_operation (A, op, slang_ref_forbid))\r
- goto end;\r
-\r
- /* TODO: convert (generic) elements */\r
-\r
- /* free the garbage */\r
- if (garbage_size != 0)\r
- {\r
- GLuint i;\r
-\r
- /* move the non-garbage part to the end of the argument */\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, 0))\r
- goto end;\r
- for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4)\r
- {\r
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_move,\r
- garbage_size + i, i))\r
- {\r
- goto end;\r
- }\r
- }\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, garbage_size + 4))\r
- goto end;\r
- }\r
-\r
- result = GL_TRUE;\r
-end:\r
- slang_storage_aggregate_destruct (&flat_agg);\r
-end2:\r
- slang_storage_aggregate_destruct (&agg);\r
-end1:\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return result;\r
-}\r
-\r
-GLboolean _slang_assemble_constructor (slang_assemble_ctx *A, slang_operation *op)\r
-{\r
- slang_assembly_typeinfo ti;\r
- GLboolean result = GL_FALSE;\r
- slang_storage_aggregate agg, flat;\r
- GLuint size, i;\r
- GLuint arg_sums[2];\r
-\r
- /* get typeinfo of the constructor (the result of constructor expression) */\r
- if (!slang_assembly_typeinfo_construct (&ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation (A, op, &ti))\r
- goto end1;\r
-\r
- /* create an aggregate of the constructor */\r
- if (!slang_storage_aggregate_construct (&agg))\r
- goto end1;\r
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,\r
- A->space.vars, A->mach, A->file, A->atoms))\r
- goto end2;\r
-\r
- /* calculate size of the constructor */\r
- size = _slang_sizeof_aggregate (&agg);\r
-\r
- /* flatten the constructor */\r
- if (!slang_storage_aggregate_construct (&flat))\r
- goto end2;\r
- if (!_slang_flatten_aggregate (&flat, &agg))\r
- goto end;\r
-\r
- /* collect the last two constructor's argument size sums */\r
- arg_sums[0] = 0; /* will hold all but the last argument's size sum */\r
- arg_sums[1] = 0; /* will hold all argument's size sum */\r
- for (i = 0; i < op->num_children; i++)\r
- {\r
- GLuint arg_size;\r
-\r
- if (!sizeof_argument (A, &arg_size, &op->children[i]))\r
- goto end;\r
- if (i > 0)\r
- arg_sums[0] = arg_sums[1];\r
- arg_sums[1] += arg_size;\r
- }\r
-\r
- /* check if there are too many arguments */\r
- if (arg_sums[0] >= size)\r
- {\r
- /* TODO: info log: too many arguments in constructor list */\r
- goto end;\r
- }\r
-\r
- /* check if there are too few arguments */\r
- if (arg_sums[1] < size)\r
- {\r
- /* TODO: info log: too few arguments in constructor list */\r
- goto end;\r
- }\r
-\r
- /* traverse the children that form the constructor expression */\r
- for (i = op->num_children; i > 0; i--)\r
- {\r
- GLuint garbage_size;\r
-\r
- /* the last argument may be too big - calculate the unnecessary data size */\r
- if (i == op->num_children)\r
- garbage_size = arg_sums[1] - size;\r
- else\r
- garbage_size = 0;\r
-\r
- if (!constructor_aggregate (A, &flat, &op->children[i - 1], garbage_size))\r
- goto end;\r
- }\r
-\r
- result = GL_TRUE;\r
-end:\r
- slang_storage_aggregate_destruct (&flat);\r
-end2:\r
- slang_storage_aggregate_destruct (&agg);\r
-end1:\r
- slang_assembly_typeinfo_destruct (&ti);\r
- return result;\r
-}\r
-\r
-/* _slang_assemble_constructor_from_swizzle() */\r
-\r
-GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *A, const slang_swizzle *swz,\r
- slang_type_specifier *spec, slang_type_specifier *master_spec)\r
-{\r
- GLuint master_rows, i;\r
-\r
- master_rows = _slang_type_dim (master_spec->type);\r
- for (i = 0; i < master_rows; i++)\r
- {\r
- switch (_slang_type_base (master_spec->type))\r
- {\r
- case slang_spec_bool:\r
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_bool_copy,\r
- (master_rows - i) * 4, i * 4))\r
- return GL_FALSE;\r
- break;\r
- case slang_spec_int:\r
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_int_copy,\r
- (master_rows - i) * 4, i * 4))\r
- return GL_FALSE;\r
- break;\r
- case slang_spec_float:\r
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_copy,\r
- (master_rows - i) * 4, i * 4))\r
- return GL_FALSE;\r
- break;\r
- default:\r
- break;\r
- }\r
- }\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
- for (i = swz->num_components; i > 0; i--)\r
- {\r
- GLuint n = i - 1;\r
-\r
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))\r
- return GL_FALSE;\r
- if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, swz->swizzle[n] * 4))\r
- return GL_FALSE;\r
- if (!slang_assembly_file_push (A->file, slang_asm_addr_add))\r
- return GL_FALSE;\r
- switch (_slang_type_base (master_spec->type))\r
- {\r
- case slang_spec_bool:\r
- if (!slang_assembly_file_push (A->file, slang_asm_bool_deref))\r
- return GL_FALSE;\r
- break;\r
- case slang_spec_int:\r
- if (!slang_assembly_file_push (A->file, slang_asm_int_deref))\r
- return GL_FALSE;\r
- break;\r
- case slang_spec_float:\r
- if (!slang_assembly_file_push (A->file, slang_asm_float_deref))\r
- return GL_FALSE;\r
- break;\r
- default:\r
- break;\r
- }\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_assemble_constructor.c
+ * slang constructor and vector swizzle assembler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_assemble.h"
+#include "slang_storage.h"
+
+/* _slang_is_swizzle() */
+
+GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz)
+{
+ GLuint i;
+ GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE;
+
+ /* the swizzle can be at most 4-component long */
+ swz->num_components = slang_string_length (field);
+ if (swz->num_components > 4)
+ return GL_FALSE;
+
+ for (i = 0; i < swz->num_components; i++)
+ {
+ /* mark which swizzle group is used */
+ switch (field[i])
+ {
+ case 'x':
+ case 'y':
+ case 'z':
+ case 'w':
+ xyzw = GL_TRUE;
+ break;
+ case 'r':
+ case 'g':
+ case 'b':
+ case 'a':
+ rgba = GL_TRUE;
+ break;
+ case 's':
+ case 't':
+ case 'p':
+ case 'q':
+ stpq = GL_TRUE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ /* collect swizzle component */
+ switch (field[i])
+ {
+ case 'x':
+ case 'r':
+ case 's':
+ swz->swizzle[i] = 0;
+ break;
+ case 'y':
+ case 'g':
+ case 't':
+ swz->swizzle[i] = 1;
+ break;
+ case 'z':
+ case 'b':
+ case 'p':
+ swz->swizzle[i] = 2;
+ break;
+ case 'w':
+ case 'a':
+ case 'q':
+ swz->swizzle[i] = 3;
+ break;
+ }
+
+ /* check if the component is valid for given vector's row count */
+ if (rows <= swz->swizzle[i])
+ return GL_FALSE;
+ }
+
+ /* only one swizzle group can be used */
+ if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq))
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+/* _slang_is_swizzle_mask() */
+
+GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows)
+{
+ GLuint i, c = 0;
+
+ /* the swizzle may not be longer than the vector dim */
+ if (swz->num_components > rows)
+ return GL_FALSE;
+
+ /* the swizzle components cannot be duplicated */
+ for (i = 0; i < swz->num_components; i++)
+ {
+ if ((c & (1 << swz->swizzle[i])) != 0)
+ return GL_FALSE;
+ c |= 1 << swz->swizzle[i];
+ }
+
+ return GL_TRUE;
+}
+
+/* _slang_multiply_swizzles() */
+
+GLvoid _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left,
+ const slang_swizzle *right)
+{
+ GLuint i;
+
+ dst->num_components = right->num_components;
+ for (i = 0; i < right->num_components; i++)
+ dst->swizzle[i] = left->swizzle[right->swizzle[i]];
+}
+
+/* _slang_assemble_constructor() */
+
+static GLboolean sizeof_argument (slang_assemble_ctx *A, GLuint *size, slang_operation *op)
+{
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat_agg;
+
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end2;
+
+ if (!slang_storage_aggregate_construct (&flat_agg))
+ goto end2;
+ if (!_slang_flatten_aggregate (&flat_agg, &agg))
+ goto end;
+
+ *size = flat_agg.count * 4;
+
+ result = GL_TRUE;
+end:
+ slang_storage_aggregate_destruct (&flat_agg);
+end2:
+ slang_storage_aggregate_destruct (&agg);
+end1:
+ slang_assembly_typeinfo_destruct (&ti);
+ return result;
+}
+
+static GLboolean constructor_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *flat,
+ slang_operation *op, GLuint garbage_size)
+{
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat_agg;
+
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end2;
+
+ if (!slang_storage_aggregate_construct (&flat_agg))
+ goto end2;
+ if (!_slang_flatten_aggregate (&flat_agg, &agg))
+ goto end;
+
+ if (!_slang_assemble_operation (A, op, slang_ref_forbid))
+ goto end;
+
+ /* TODO: convert (generic) elements */
+
+ /* free the garbage */
+ if (garbage_size != 0)
+ {
+ GLuint i;
+
+ /* move the non-garbage part to the end of the argument */
+ if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, 0))
+ goto end;
+ for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4)
+ {
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_move,
+ garbage_size + i, i))
+ {
+ goto end;
+ }
+ }
+ if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, garbage_size + 4))
+ goto end;
+ }
+
+ result = GL_TRUE;
+end:
+ slang_storage_aggregate_destruct (&flat_agg);
+end2:
+ slang_storage_aggregate_destruct (&agg);
+end1:
+ slang_assembly_typeinfo_destruct (&ti);
+ return result;
+}
+
+GLboolean _slang_assemble_constructor (slang_assemble_ctx *A, slang_operation *op)
+{
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat;
+ GLuint size, i;
+ GLuint arg_sums[2];
+
+ /* get typeinfo of the constructor (the result of constructor expression) */
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ /* create an aggregate of the constructor */
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end2;
+
+ /* calculate size of the constructor */
+ size = _slang_sizeof_aggregate (&agg);
+
+ /* flatten the constructor */
+ if (!slang_storage_aggregate_construct (&flat))
+ goto end2;
+ if (!_slang_flatten_aggregate (&flat, &agg))
+ goto end;
+
+ /* collect the last two constructor's argument size sums */
+ arg_sums[0] = 0; /* will hold all but the last argument's size sum */
+ arg_sums[1] = 0; /* will hold all argument's size sum */
+ for (i = 0; i < op->num_children; i++)
+ {
+ GLuint arg_size;
+
+ if (!sizeof_argument (A, &arg_size, &op->children[i]))
+ goto end;
+ if (i > 0)
+ arg_sums[0] = arg_sums[1];
+ arg_sums[1] += arg_size;
+ }
+
+ /* check if there are too many arguments */
+ if (arg_sums[0] >= size)
+ {
+ /* TODO: info log: too many arguments in constructor list */
+ goto end;
+ }
+
+ /* check if there are too few arguments */
+ if (arg_sums[1] < size)
+ {
+ /* TODO: info log: too few arguments in constructor list */
+ goto end;
+ }
+
+ /* traverse the children that form the constructor expression */
+ for (i = op->num_children; i > 0; i--)
+ {
+ GLuint garbage_size;
+
+ /* the last argument may be too big - calculate the unnecessary data size */
+ if (i == op->num_children)
+ garbage_size = arg_sums[1] - size;
+ else
+ garbage_size = 0;
+
+ if (!constructor_aggregate (A, &flat, &op->children[i - 1], garbage_size))
+ goto end;
+ }
+
+ result = GL_TRUE;
+end:
+ slang_storage_aggregate_destruct (&flat);
+end2:
+ slang_storage_aggregate_destruct (&agg);
+end1:
+ slang_assembly_typeinfo_destruct (&ti);
+ return result;
+}
+
+/* _slang_assemble_constructor_from_swizzle() */
+
+GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *A, const slang_swizzle *swz,
+ slang_type_specifier *spec, slang_type_specifier *master_spec)
+{
+ GLuint master_rows, i;
+
+ master_rows = _slang_type_dim (master_spec->type);
+ for (i = 0; i < master_rows; i++)
+ {
+ switch (_slang_type_base (master_spec->type))
+ {
+ case slang_spec_bool:
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_bool_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ case slang_spec_int:
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_int_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ case slang_spec_float:
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+ if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ for (i = swz->num_components; i > 0; i--)
+ {
+ GLuint n = i - 1;
+
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, swz->swizzle[n] * 4))
+ return GL_FALSE;
+ if (!slang_assembly_file_push (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ switch (_slang_type_base (master_spec->type))
+ {
+ case slang_spec_bool:
+ if (!slang_assembly_file_push (A->file, slang_asm_bool_deref))
+ return GL_FALSE;
+ break;
+ case slang_spec_int:
+ if (!slang_assembly_file_push (A->file, slang_asm_int_deref))
+ return GL_FALSE;
+ break;
+ case slang_spec_float:
+ if (!slang_assembly_file_push (A->file, slang_asm_float_deref))
+ return GL_FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return GL_TRUE;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H\r
-#define SLANG_ASSEMBLE_CONSTRUCTOR_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/*\r
- * Checks if a field selector is a general swizzle (an r-value swizzle with replicated\r
- * components or an l-value swizzle mask) for a vector.\r
- * Returns GL_TRUE if this is the case, <swz> is filled with swizzle information.\r
- * Returns GL_FALSE otherwise.\r
- */\r
-GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz);\r
-\r
-/*\r
- * Checks if a general swizzle is an l-value swizzle - these swizzles do not have\r
- * duplicated fields.\r
- * Returns GL_TRUE if this is a swizzle mask.\r
- * Returns GL_FALSE otherwise\r
- */\r
-GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows);\r
-\r
-/*\r
- * Combines (multiplies) two swizzles to form single swizzle.\r
- * Example: "vec.wzyx.yx" --> "vec.zw".\r
- */\r
-GLvoid _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);\r
-\r
-GLboolean _slang_assemble_constructor (slang_assemble_ctx *, struct slang_operation_ *);\r
-\r
-GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *, const slang_swizzle *,\r
- slang_type_specifier *, slang_type_specifier *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H
+#define SLANG_ASSEMBLE_CONSTRUCTOR_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Checks if a field selector is a general swizzle (an r-value swizzle with replicated
+ * components or an l-value swizzle mask) for a vector.
+ * Returns GL_TRUE if this is the case, <swz> is filled with swizzle information.
+ * Returns GL_FALSE otherwise.
+ */
+GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz);
+
+/*
+ * Checks if a general swizzle is an l-value swizzle - these swizzles do not have
+ * duplicated fields.
+ * Returns GL_TRUE if this is a swizzle mask.
+ * Returns GL_FALSE otherwise
+ */
+GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows);
+
+/*
+ * Combines (multiplies) two swizzles to form single swizzle.
+ * Example: "vec.wzyx.yx" --> "vec.zw".
+ */
+GLvoid _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);
+
+GLboolean _slang_assemble_constructor (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *, const slang_swizzle *,
+ slang_type_specifier *, slang_type_specifier *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_assemble_typeinfo.c\r
- * slang type info\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_assemble.h"\r
-#include "slang_compile.h"\r
-\r
-/*\r
- * slang_type_specifier\r
- */\r
-\r
-GLvoid slang_type_specifier_ctr (slang_type_specifier *self)\r
-{\r
- self->type = slang_spec_void;\r
- self->_struct = NULL;\r
- self->_array = NULL;\r
-}\r
-\r
-GLvoid slang_type_specifier_dtr (slang_type_specifier *self)\r
-{\r
- if (self->_struct != NULL)\r
- {\r
- slang_struct_destruct (self->_struct);\r
- slang_alloc_free (self->_struct);\r
- }\r
- if (self->_array != NULL)\r
- {\r
- slang_type_specifier_dtr (self->_array);\r
- slang_alloc_free (self->_array);\r
- }\r
-}\r
-\r
-GLboolean slang_type_specifier_copy (slang_type_specifier *x, const slang_type_specifier *y)\r
-{\r
- slang_type_specifier z;\r
-\r
- slang_type_specifier_ctr (&z);\r
- z.type = y->type;\r
- if (z.type == slang_spec_struct)\r
- {\r
- z._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));\r
- if (z._struct == NULL)\r
- {\r
- slang_type_specifier_dtr (&z);\r
- return GL_FALSE;\r
- }\r
- if (!slang_struct_construct (z._struct))\r
- {\r
- slang_alloc_free (z._struct);\r
- slang_type_specifier_dtr (&z);\r
- return GL_FALSE;\r
- }\r
- if (!slang_struct_copy (z._struct, y->_struct))\r
- {\r
- slang_type_specifier_dtr (&z);\r
- return GL_FALSE;\r
- }\r
- }\r
- else if (z.type == slang_spec_array)\r
- {\r
- z._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (slang_type_specifier));\r
- if (z._array == NULL)\r
- {\r
- slang_type_specifier_dtr (&z);\r
- return GL_FALSE;\r
- }\r
- slang_type_specifier_ctr (z._array);\r
- if (!slang_type_specifier_copy (z._array, y->_array))\r
- {\r
- slang_type_specifier_dtr (&z);\r
- return GL_FALSE;\r
- }\r
- }\r
- slang_type_specifier_dtr (x);\r
- *x = z;\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean slang_type_specifier_equal (const slang_type_specifier *x, const slang_type_specifier *y)\r
-{\r
- if (x->type != y->type)\r
- return 0;\r
- if (x->type == slang_spec_struct)\r
- return slang_struct_equal (x->_struct, y->_struct);\r
- if (x->type == slang_spec_array)\r
- return slang_type_specifier_equal (x->_array, y->_array);\r
- return 1;\r
-}\r
-\r
-/* slang_assembly_typeinfo */\r
-\r
-GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *ti)\r
-{\r
- slang_type_specifier_ctr (&ti->spec);\r
- ti->array_len = 0;\r
- return GL_TRUE;\r
-}\r
-\r
-GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *ti)\r
-{\r
- slang_type_specifier_dtr (&ti->spec);\r
-}\r
-\r
-/* _slang_typeof_operation() */\r
-\r
-static GLboolean typeof_existing_function (const char *name, slang_operation *params,\r
- GLuint num_params, slang_assembly_name_space *space, slang_type_specifier *spec,\r
- slang_atom_pool *atoms)\r
-{\r
- slang_atom atom;\r
- GLboolean exists;\r
-\r
- atom = slang_atom_pool_atom (atoms, name);\r
- if (!_slang_typeof_function (atom, params, num_params, space, spec, &exists, atoms))\r
- return GL_FALSE;\r
- return exists;\r
-}\r
-\r
-GLboolean _slang_typeof_operation (slang_assemble_ctx *A, slang_operation *op,\r
- slang_assembly_typeinfo *ti)\r
-{\r
- return _slang_typeof_operation_ (op, &A->space, ti, A->atoms);\r
-}\r
-\r
-GLboolean _slang_typeof_operation_ (slang_operation *op, slang_assembly_name_space *space,\r
- slang_assembly_typeinfo *ti, slang_atom_pool *atoms)\r
-{\r
- ti->can_be_referenced = GL_FALSE;\r
- ti->is_swizzled = GL_FALSE;\r
-\r
- switch (op->type)\r
- {\r
- case slang_oper_block_no_new_scope:\r
- case slang_oper_block_new_scope:\r
- case slang_oper_variable_decl:\r
- case slang_oper_asm:\r
- case slang_oper_break:\r
- case slang_oper_continue:\r
- case slang_oper_discard:\r
- case slang_oper_return:\r
- case slang_oper_if:\r
- case slang_oper_while:\r
- case slang_oper_do:\r
- case slang_oper_for:\r
- case slang_oper_void:\r
- ti->spec.type = slang_spec_void;\r
- break;\r
- case slang_oper_expression:\r
- case slang_oper_assign:\r
- case slang_oper_addassign:\r
- case slang_oper_subassign:\r
- case slang_oper_mulassign:\r
- case slang_oper_divassign:\r
- case slang_oper_preincrement:\r
- case slang_oper_predecrement:\r
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))\r
- return 0;\r
- break;\r
- case slang_oper_literal_bool:\r
- case slang_oper_logicalor:\r
- case slang_oper_logicalxor:\r
- case slang_oper_logicaland:\r
- case slang_oper_equal:\r
- case slang_oper_notequal:\r
- case slang_oper_less:\r
- case slang_oper_greater:\r
- case slang_oper_lessequal:\r
- case slang_oper_greaterequal:\r
- case slang_oper_not:\r
- ti->spec.type = slang_spec_bool;\r
- break;\r
- case slang_oper_literal_int:\r
- ti->spec.type = slang_spec_int;\r
- break;\r
- case slang_oper_literal_float:\r
- ti->spec.type = slang_spec_float;\r
- break;\r
- case slang_oper_identifier:\r
- {\r
- slang_variable *var;\r
-\r
- var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);\r
- if (var == NULL)\r
- return GL_FALSE;\r
- if (!slang_type_specifier_copy (&ti->spec, &var->type.specifier))\r
- return GL_FALSE;\r
- ti->can_be_referenced = GL_TRUE;\r
- ti->array_len = var->array_len;\r
- }\r
- break;\r
- case slang_oper_sequence:\r
- /* TODO: check [0] and [1] if they match */\r
- if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))\r
- return GL_FALSE;\r
- ti->can_be_referenced = GL_FALSE;\r
- ti->is_swizzled = GL_FALSE;\r
- break;\r
- /*case slang_oper_modassign:*/\r
- /*case slang_oper_lshassign:*/\r
- /*case slang_oper_rshassign:*/\r
- /*case slang_oper_orassign:*/\r
- /*case slang_oper_xorassign:*/\r
- /*case slang_oper_andassign:*/\r
- case slang_oper_select:\r
- /* TODO: check [1] and [2] if they match */\r
- if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))\r
- return GL_FALSE;\r
- ti->can_be_referenced = GL_FALSE;\r
- ti->is_swizzled = GL_FALSE;\r
- break;\r
- /*case slang_oper_bitor:*/\r
- /*case slang_oper_bitxor:*/\r
- /*case slang_oper_bitand:*/\r
- /*case slang_oper_lshift:*/\r
- /*case slang_oper_rshift:*/\r
- case slang_oper_add:\r
- if (!typeof_existing_function ("+", op->children, 2, space, &ti->spec, atoms))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_subtract:\r
- if (!typeof_existing_function ("-", op->children, 2, space, &ti->spec, atoms))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_multiply:\r
- if (!typeof_existing_function ("*", op->children, 2, space, &ti->spec, atoms))\r
- return GL_FALSE;\r
- break;\r
- case slang_oper_divide:\r
- if (!typeof_existing_function ("/", op->children, 2, space, &ti->spec, atoms))\r
- return GL_FALSE;\r
- break;\r
- /*case slang_oper_modulus:*/\r
- case slang_oper_plus:\r
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))\r
- return GL_FALSE;\r
- ti->can_be_referenced = GL_FALSE;\r
- ti->is_swizzled = GL_FALSE;\r
- break;\r
- case slang_oper_minus:\r
- if (!typeof_existing_function ("-", op->children, 1, space, &ti->spec, atoms))\r
- return GL_FALSE;\r
- break;\r
- /*case slang_oper_complement:*/\r
- case slang_oper_subscript:\r
- {\r
- slang_assembly_typeinfo _ti;\r
-\r
- if (!slang_assembly_typeinfo_construct (&_ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- ti->can_be_referenced = _ti.can_be_referenced;\r
- if (_ti.spec.type == slang_spec_array)\r
- {\r
- if (!slang_type_specifier_copy (&ti->spec, _ti.spec._array))\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- }\r
- else\r
- {\r
- if (!_slang_type_is_vector (_ti.spec.type) && !_slang_type_is_matrix (_ti.spec.type))\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- ti->spec.type = _slang_type_base (_ti.spec.type);\r
- }\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- }\r
- break;\r
- case slang_oper_call:\r
- {\r
- GLboolean exists;\r
-\r
- if (!_slang_typeof_function (op->a_id, op->children, op->num_children, space, &ti->spec,\r
- &exists, atoms))\r
- return GL_FALSE;\r
- if (!exists)\r
- {\r
- slang_struct *s = slang_struct_scope_find (space->structs, op->a_id, GL_TRUE);\r
- if (s != NULL)\r
- {\r
- ti->spec.type = slang_spec_struct;\r
- ti->spec._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));\r
- if (ti->spec._struct == NULL)\r
- return GL_FALSE;\r
- if (!slang_struct_construct (ti->spec._struct))\r
- {\r
- slang_alloc_free (ti->spec._struct);\r
- ti->spec._struct = NULL;\r
- return GL_FALSE;\r
- }\r
- if (!slang_struct_copy (ti->spec._struct, s))\r
- return GL_FALSE;\r
- }\r
- else\r
- {\r
- const char *name;\r
- slang_type_specifier_type type;\r
-\r
- name = slang_atom_pool_id (atoms, op->a_id);\r
- type = slang_type_specifier_type_from_string (name);\r
- if (type == slang_spec_void)\r
- return GL_FALSE;\r
- ti->spec.type = type;\r
- }\r
- }\r
- }\r
- break;\r
- case slang_oper_field:\r
- {\r
- slang_assembly_typeinfo _ti;\r
-\r
- if (!slang_assembly_typeinfo_construct (&_ti))\r
- return GL_FALSE;\r
- if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- if (_ti.spec.type == slang_spec_struct)\r
- {\r
- slang_variable *field;\r
- \r
- field = _slang_locate_variable (_ti.spec._struct->fields, op->a_id, GL_FALSE);\r
- if (field == NULL)\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- if (!slang_type_specifier_copy (&ti->spec, &field->type.specifier))\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- ti->can_be_referenced = _ti.can_be_referenced;\r
- }\r
- else\r
- {\r
- GLuint rows;\r
- const char *swizzle;\r
- slang_type_specifier_type base;\r
-\r
- /* determine the swizzle of the field expression */\r
- if (!_slang_type_is_vector (_ti.spec.type))\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- rows = _slang_type_dim (_ti.spec.type);\r
- swizzle = slang_atom_pool_id (atoms, op->a_id);\r
- if (!_slang_is_swizzle (swizzle, rows, &ti->swz))\r
- {\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- return GL_FALSE;\r
- }\r
- ti->is_swizzled = GL_TRUE;\r
- ti->can_be_referenced = _ti.can_be_referenced && _slang_is_swizzle_mask (&ti->swz,\r
- rows);\r
- if (_ti.is_swizzled)\r
- {\r
- slang_swizzle swz;\r
-\r
- /* swizzle the swizzle */\r
- _slang_multiply_swizzles (&swz, &_ti.swz, &ti->swz);\r
- ti->swz = swz;\r
- }\r
- base = _slang_type_base (_ti.spec.type);\r
- switch (ti->swz.num_components)\r
- {\r
- case 1:\r
- ti->spec.type = base;\r
- break;\r
- case 2:\r
- switch (base)\r
- {\r
- case slang_spec_float:\r
- ti->spec.type = slang_spec_vec2;\r
- break;\r
- case slang_spec_int:\r
- ti->spec.type = slang_spec_ivec2;\r
- break;\r
- case slang_spec_bool:\r
- ti->spec.type = slang_spec_bvec2;\r
- break;\r
- default:\r
- break;\r
- }\r
- break;\r
- case 3:\r
- switch (base)\r
- {\r
- case slang_spec_float:\r
- ti->spec.type = slang_spec_vec3;\r
- break;\r
- case slang_spec_int:\r
- ti->spec.type = slang_spec_ivec3;\r
- break;\r
- case slang_spec_bool:\r
- ti->spec.type = slang_spec_bvec3;\r
- break;\r
- default:\r
- break;\r
- }\r
- break;\r
- case 4:\r
- switch (base)\r
- {\r
- case slang_spec_float:\r
- ti->spec.type = slang_spec_vec4;\r
- break;\r
- case slang_spec_int:\r
- ti->spec.type = slang_spec_ivec4;\r
- break;\r
- case slang_spec_bool:\r
- ti->spec.type = slang_spec_bvec4;\r
- break;\r
- default:\r
- break;\r
- }\r
- break;\r
- default:\r
- break;\r
- }\r
- }\r
- slang_assembly_typeinfo_destruct (&_ti);\r
- }\r
- break;\r
- case slang_oper_postincrement:\r
- case slang_oper_postdecrement:\r
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))\r
- return GL_FALSE;\r
- ti->can_be_referenced = GL_FALSE;\r
- ti->is_swizzled = GL_FALSE;\r
- break;\r
- default:\r
- return GL_FALSE;\r
- }\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-/* _slang_typeof_function() */\r
-\r
-GLboolean _slang_typeof_function (slang_atom a_name, slang_operation *params, GLuint num_params,\r
- slang_assembly_name_space *space, slang_type_specifier *spec, GLboolean *exists,\r
- slang_atom_pool *atoms)\r
-{\r
- slang_function *fun;\r
- \r
- fun = _slang_locate_function (space->funcs, a_name, params, num_params, space, atoms);\r
- *exists = fun != NULL;\r
- if (fun == NULL)\r
- return GL_TRUE;\r
- return slang_type_specifier_copy (spec, &fun->header.type.specifier);\r
-}\r
-\r
-/* _slang_type_is_matrix() */\r
-\r
-GLboolean _slang_type_is_matrix (slang_type_specifier_type ty)\r
-{\r
- switch (ty)\r
- {\r
- case slang_spec_mat2:\r
- case slang_spec_mat3:\r
- case slang_spec_mat4:\r
- return GL_TRUE;\r
- default:\r
- return GL_FALSE;\r
- }\r
-}\r
-\r
-/* _slang_type_is_vector() */\r
-\r
-GLboolean _slang_type_is_vector (slang_type_specifier_type ty)\r
-{\r
- switch (ty)\r
- {\r
- case slang_spec_vec2:\r
- case slang_spec_vec3:\r
- case slang_spec_vec4:\r
- case slang_spec_ivec2:\r
- case slang_spec_ivec3:\r
- case slang_spec_ivec4:\r
- case slang_spec_bvec2:\r
- case slang_spec_bvec3:\r
- case slang_spec_bvec4:\r
- return GL_TRUE;\r
- default:\r
- return GL_FALSE;\r
- }\r
-}\r
-\r
-/* _slang_type_base_of_vector() */\r
-\r
-slang_type_specifier_type _slang_type_base (slang_type_specifier_type ty)\r
-{\r
- switch (ty)\r
- {\r
- case slang_spec_float:\r
- case slang_spec_vec2:\r
- case slang_spec_vec3:\r
- case slang_spec_vec4:\r
- return slang_spec_float;\r
- case slang_spec_int:\r
- case slang_spec_ivec2:\r
- case slang_spec_ivec3:\r
- case slang_spec_ivec4:\r
- return slang_spec_int;\r
- case slang_spec_bool:\r
- case slang_spec_bvec2:\r
- case slang_spec_bvec3:\r
- case slang_spec_bvec4:\r
- return slang_spec_bool;\r
- case slang_spec_mat2:\r
- return slang_spec_vec2;\r
- case slang_spec_mat3:\r
- return slang_spec_vec3;\r
- case slang_spec_mat4:\r
- return slang_spec_vec4;\r
- default:\r
- return slang_spec_void;\r
- }\r
-}\r
-\r
-/* _slang_type_dim */\r
-\r
-GLuint _slang_type_dim (slang_type_specifier_type ty)\r
-{\r
- switch (ty)\r
- {\r
- case slang_spec_float:\r
- case slang_spec_int:\r
- case slang_spec_bool:\r
- return 1;\r
- case slang_spec_vec2:\r
- case slang_spec_ivec2:\r
- case slang_spec_bvec2:\r
- case slang_spec_mat2:\r
- return 2;\r
- case slang_spec_vec3:\r
- case slang_spec_ivec3:\r
- case slang_spec_bvec3:\r
- case slang_spec_mat3:\r
- return 3;\r
- case slang_spec_vec4:\r
- case slang_spec_ivec4:\r
- case slang_spec_bvec4:\r
- case slang_spec_mat4:\r
- return 4;\r
- default:\r
- return 0;\r
- }\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_assemble_typeinfo.c
+ * slang type info
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_assemble.h"
+#include "slang_compile.h"
+
+/*
+ * slang_type_specifier
+ */
+
+GLvoid slang_type_specifier_ctr (slang_type_specifier *self)
+{
+ self->type = slang_spec_void;
+ self->_struct = NULL;
+ self->_array = NULL;
+}
+
+GLvoid slang_type_specifier_dtr (slang_type_specifier *self)
+{
+ if (self->_struct != NULL)
+ {
+ slang_struct_destruct (self->_struct);
+ slang_alloc_free (self->_struct);
+ }
+ if (self->_array != NULL)
+ {
+ slang_type_specifier_dtr (self->_array);
+ slang_alloc_free (self->_array);
+ }
+}
+
+GLboolean slang_type_specifier_copy (slang_type_specifier *x, const slang_type_specifier *y)
+{
+ slang_type_specifier z;
+
+ slang_type_specifier_ctr (&z);
+ z.type = y->type;
+ if (z.type == slang_spec_struct)
+ {
+ z._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
+ if (z._struct == NULL)
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_construct (z._struct))
+ {
+ slang_alloc_free (z._struct);
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_copy (z._struct, y->_struct))
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ }
+ else if (z.type == slang_spec_array)
+ {
+ z._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (slang_type_specifier));
+ if (z._array == NULL)
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ slang_type_specifier_ctr (z._array);
+ if (!slang_type_specifier_copy (z._array, y->_array))
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ }
+ slang_type_specifier_dtr (x);
+ *x = z;
+ return GL_TRUE;
+}
+
+GLboolean slang_type_specifier_equal (const slang_type_specifier *x, const slang_type_specifier *y)
+{
+ if (x->type != y->type)
+ return 0;
+ if (x->type == slang_spec_struct)
+ return slang_struct_equal (x->_struct, y->_struct);
+ if (x->type == slang_spec_array)
+ return slang_type_specifier_equal (x->_array, y->_array);
+ return 1;
+}
+
+/* slang_assembly_typeinfo */
+
+GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *ti)
+{
+ slang_type_specifier_ctr (&ti->spec);
+ ti->array_len = 0;
+ return GL_TRUE;
+}
+
+GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *ti)
+{
+ slang_type_specifier_dtr (&ti->spec);
+}
+
+/* _slang_typeof_operation() */
+
+static GLboolean typeof_existing_function (const char *name, slang_operation *params,
+ GLuint num_params, slang_assembly_name_space *space, slang_type_specifier *spec,
+ slang_atom_pool *atoms)
+{
+ slang_atom atom;
+ GLboolean exists;
+
+ atom = slang_atom_pool_atom (atoms, name);
+ if (!_slang_typeof_function (atom, params, num_params, space, spec, &exists, atoms))
+ return GL_FALSE;
+ return exists;
+}
+
+GLboolean _slang_typeof_operation (slang_assemble_ctx *A, slang_operation *op,
+ slang_assembly_typeinfo *ti)
+{
+ return _slang_typeof_operation_ (op, &A->space, ti, A->atoms);
+}
+
+GLboolean _slang_typeof_operation_ (slang_operation *op, slang_assembly_name_space *space,
+ slang_assembly_typeinfo *ti, slang_atom_pool *atoms)
+{
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+
+ switch (op->type)
+ {
+ case slang_oper_block_no_new_scope:
+ case slang_oper_block_new_scope:
+ case slang_oper_variable_decl:
+ case slang_oper_asm:
+ case slang_oper_break:
+ case slang_oper_continue:
+ case slang_oper_discard:
+ case slang_oper_return:
+ case slang_oper_if:
+ case slang_oper_while:
+ case slang_oper_do:
+ case slang_oper_for:
+ case slang_oper_void:
+ ti->spec.type = slang_spec_void;
+ break;
+ case slang_oper_expression:
+ case slang_oper_assign:
+ case slang_oper_addassign:
+ case slang_oper_subassign:
+ case slang_oper_mulassign:
+ case slang_oper_divassign:
+ case slang_oper_preincrement:
+ case slang_oper_predecrement:
+ if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
+ return 0;
+ break;
+ case slang_oper_literal_bool:
+ case slang_oper_logicalor:
+ case slang_oper_logicalxor:
+ case slang_oper_logicaland:
+ case slang_oper_equal:
+ case slang_oper_notequal:
+ case slang_oper_less:
+ case slang_oper_greater:
+ case slang_oper_lessequal:
+ case slang_oper_greaterequal:
+ case slang_oper_not:
+ ti->spec.type = slang_spec_bool;
+ break;
+ case slang_oper_literal_int:
+ ti->spec.type = slang_spec_int;
+ break;
+ case slang_oper_literal_float:
+ ti->spec.type = slang_spec_float;
+ break;
+ case slang_oper_identifier:
+ {
+ slang_variable *var;
+
+ var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
+ if (var == NULL)
+ return GL_FALSE;
+ if (!slang_type_specifier_copy (&ti->spec, &var->type.specifier))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_TRUE;
+ ti->array_len = var->array_len;
+ }
+ break;
+ case slang_oper_sequence:
+ /* TODO: check [0] and [1] if they match */
+ if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ /*case slang_oper_modassign:*/
+ /*case slang_oper_lshassign:*/
+ /*case slang_oper_rshassign:*/
+ /*case slang_oper_orassign:*/
+ /*case slang_oper_xorassign:*/
+ /*case slang_oper_andassign:*/
+ case slang_oper_select:
+ /* TODO: check [1] and [2] if they match */
+ if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ /*case slang_oper_bitor:*/
+ /*case slang_oper_bitxor:*/
+ /*case slang_oper_bitand:*/
+ /*case slang_oper_lshift:*/
+ /*case slang_oper_rshift:*/
+ case slang_oper_add:
+ if (!typeof_existing_function ("+", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_subtract:
+ if (!typeof_existing_function ("-", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_multiply:
+ if (!typeof_existing_function ("*", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_divide:
+ if (!typeof_existing_function ("/", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ /*case slang_oper_modulus:*/
+ case slang_oper_plus:
+ if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ case slang_oper_minus:
+ if (!typeof_existing_function ("-", op->children, 1, space, &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ /*case slang_oper_complement:*/
+ case slang_oper_subscript:
+ {
+ slang_assembly_typeinfo _ti;
+
+ if (!slang_assembly_typeinfo_construct (&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ ti->can_be_referenced = _ti.can_be_referenced;
+ if (_ti.spec.type == slang_spec_array)
+ {
+ if (!slang_type_specifier_copy (&ti->spec, _ti.spec._array))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ }
+ else
+ {
+ if (!_slang_type_is_vector (_ti.spec.type) && !_slang_type_is_matrix (_ti.spec.type))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ ti->spec.type = _slang_type_base (_ti.spec.type);
+ }
+ slang_assembly_typeinfo_destruct (&_ti);
+ }
+ break;
+ case slang_oper_call:
+ {
+ GLboolean exists;
+
+ if (!_slang_typeof_function (op->a_id, op->children, op->num_children, space, &ti->spec,
+ &exists, atoms))
+ return GL_FALSE;
+ if (!exists)
+ {
+ slang_struct *s = slang_struct_scope_find (space->structs, op->a_id, GL_TRUE);
+ if (s != NULL)
+ {
+ ti->spec.type = slang_spec_struct;
+ ti->spec._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
+ if (ti->spec._struct == NULL)
+ return GL_FALSE;
+ if (!slang_struct_construct (ti->spec._struct))
+ {
+ slang_alloc_free (ti->spec._struct);
+ ti->spec._struct = NULL;
+ return GL_FALSE;
+ }
+ if (!slang_struct_copy (ti->spec._struct, s))
+ return GL_FALSE;
+ }
+ else
+ {
+ const char *name;
+ slang_type_specifier_type type;
+
+ name = slang_atom_pool_id (atoms, op->a_id);
+ type = slang_type_specifier_type_from_string (name);
+ if (type == slang_spec_void)
+ return GL_FALSE;
+ ti->spec.type = type;
+ }
+ }
+ }
+ break;
+ case slang_oper_field:
+ {
+ slang_assembly_typeinfo _ti;
+
+ if (!slang_assembly_typeinfo_construct (&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ if (_ti.spec.type == slang_spec_struct)
+ {
+ slang_variable *field;
+
+ field = _slang_locate_variable (_ti.spec._struct->fields, op->a_id, GL_FALSE);
+ if (field == NULL)
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ if (!slang_type_specifier_copy (&ti->spec, &field->type.specifier))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ ti->can_be_referenced = _ti.can_be_referenced;
+ }
+ else
+ {
+ GLuint rows;
+ const char *swizzle;
+ slang_type_specifier_type base;
+
+ /* determine the swizzle of the field expression */
+ if (!_slang_type_is_vector (_ti.spec.type))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ rows = _slang_type_dim (_ti.spec.type);
+ swizzle = slang_atom_pool_id (atoms, op->a_id);
+ if (!_slang_is_swizzle (swizzle, rows, &ti->swz))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ ti->is_swizzled = GL_TRUE;
+ ti->can_be_referenced = _ti.can_be_referenced && _slang_is_swizzle_mask (&ti->swz,
+ rows);
+ if (_ti.is_swizzled)
+ {
+ slang_swizzle swz;
+
+ /* swizzle the swizzle */
+ _slang_multiply_swizzles (&swz, &_ti.swz, &ti->swz);
+ ti->swz = swz;
+ }
+ base = _slang_type_base (_ti.spec.type);
+ switch (ti->swz.num_components)
+ {
+ case 1:
+ ti->spec.type = base;
+ break;
+ case 2:
+ switch (base)
+ {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec2;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec2;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec2;
+ break;
+ default:
+ break;
+ }
+ break;
+ case 3:
+ switch (base)
+ {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec3;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec3;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec3;
+ break;
+ default:
+ break;
+ }
+ break;
+ case 4:
+ switch (base)
+ {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec4;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec4;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec4;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ slang_assembly_typeinfo_destruct (&_ti);
+ }
+ break;
+ case slang_oper_postincrement:
+ case slang_oper_postdecrement:
+ if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+/* _slang_typeof_function() */
+
+GLboolean _slang_typeof_function (slang_atom a_name, slang_operation *params, GLuint num_params,
+ slang_assembly_name_space *space, slang_type_specifier *spec, GLboolean *exists,
+ slang_atom_pool *atoms)
+{
+ slang_function *fun;
+
+ fun = _slang_locate_function (space->funcs, a_name, params, num_params, space, atoms);
+ *exists = fun != NULL;
+ if (fun == NULL)
+ return GL_TRUE;
+ return slang_type_specifier_copy (spec, &fun->header.type.specifier);
+}
+
+/* _slang_type_is_matrix() */
+
+GLboolean _slang_type_is_matrix (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_mat2:
+ case slang_spec_mat3:
+ case slang_spec_mat4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+/* _slang_type_is_vector() */
+
+GLboolean _slang_type_is_vector (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+/* _slang_type_base_of_vector() */
+
+slang_type_specifier_type _slang_type_base (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_float:
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ return slang_spec_float;
+ case slang_spec_int:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ return slang_spec_int;
+ case slang_spec_bool:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return slang_spec_bool;
+ case slang_spec_mat2:
+ return slang_spec_vec2;
+ case slang_spec_mat3:
+ return slang_spec_vec3;
+ case slang_spec_mat4:
+ return slang_spec_vec4;
+ default:
+ return slang_spec_void;
+ }
+}
+
+/* _slang_type_dim */
+
+GLuint _slang_type_dim (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_float:
+ case slang_spec_int:
+ case slang_spec_bool:
+ return 1;
+ case slang_spec_vec2:
+ case slang_spec_ivec2:
+ case slang_spec_bvec2:
+ case slang_spec_mat2:
+ return 2;
+ case slang_spec_vec3:
+ case slang_spec_ivec3:
+ case slang_spec_bvec3:
+ case slang_spec_mat3:
+ return 3;
+ case slang_spec_vec4:
+ case slang_spec_ivec4:
+ case slang_spec_bvec4:
+ case slang_spec_mat4:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_ASSEMBLE_TYPEINFO_H\r
-#define SLANG_ASSEMBLE_TYPEINFO_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef enum slang_type_specifier_type_\r
-{\r
- slang_spec_void,\r
- slang_spec_bool,\r
- slang_spec_bvec2,\r
- slang_spec_bvec3,\r
- slang_spec_bvec4,\r
- slang_spec_int,\r
- slang_spec_ivec2,\r
- slang_spec_ivec3,\r
- slang_spec_ivec4,\r
- slang_spec_float,\r
- slang_spec_vec2,\r
- slang_spec_vec3,\r
- slang_spec_vec4,\r
- slang_spec_mat2,\r
- slang_spec_mat3,\r
- slang_spec_mat4,\r
- slang_spec_sampler1D,\r
- slang_spec_sampler2D,\r
- slang_spec_sampler3D,\r
- slang_spec_samplerCube,\r
- slang_spec_sampler1DShadow,\r
- slang_spec_sampler2DShadow,\r
- slang_spec_struct,\r
- slang_spec_array\r
-} slang_type_specifier_type;\r
-\r
-typedef struct slang_type_specifier_\r
-{\r
- slang_type_specifier_type type;\r
- struct slang_struct_ *_struct; /* type: spec_struct */\r
- struct slang_type_specifier_ *_array; /* type: spec_array */\r
-} slang_type_specifier;\r
-\r
-GLvoid slang_type_specifier_ctr (slang_type_specifier *);\r
-GLvoid slang_type_specifier_dtr (slang_type_specifier *);\r
-GLboolean slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);\r
-GLboolean slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *);\r
-\r
-typedef struct slang_assembly_typeinfo_\r
-{\r
- GLboolean can_be_referenced;\r
- GLboolean is_swizzled;\r
- slang_swizzle swz;\r
- slang_type_specifier spec;\r
- GLuint array_len;\r
-} slang_assembly_typeinfo;\r
-\r
-GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);\r
-GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);\r
-\r
-/*\r
- * Retrieves type information about an operation.\r
- * Returns GL_TRUE on success.\r
- * Returns GL_FALSE otherwise.\r
- */\r
-GLboolean _slang_typeof_operation (slang_assemble_ctx *, struct slang_operation_ *,\r
- slang_assembly_typeinfo *);\r
-GLboolean _slang_typeof_operation_ (struct slang_operation_ *, slang_assembly_name_space *,\r
- slang_assembly_typeinfo *, slang_atom_pool *);\r
-\r
-/*\r
- * Retrieves type of a function prototype, if one exists.\r
- * Returns GL_TRUE on success, even if the function was not found.\r
- * Returns GL_FALSE otherwise.\r
- */\r
-GLboolean _slang_typeof_function (slang_atom a_name, struct slang_operation_ *params,\r
- GLuint num_params, slang_assembly_name_space *, slang_type_specifier *spec, GLboolean *exists,\r
- slang_atom_pool *);\r
-\r
-GLboolean _slang_type_is_matrix (slang_type_specifier_type);\r
-\r
-GLboolean _slang_type_is_vector (slang_type_specifier_type);\r
-\r
-slang_type_specifier_type _slang_type_base (slang_type_specifier_type);\r
-\r
-GLuint _slang_type_dim (slang_type_specifier_type);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_ASSEMBLE_TYPEINFO_H
+#define SLANG_ASSEMBLE_TYPEINFO_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef enum slang_type_specifier_type_
+{
+ slang_spec_void,
+ slang_spec_bool,
+ slang_spec_bvec2,
+ slang_spec_bvec3,
+ slang_spec_bvec4,
+ slang_spec_int,
+ slang_spec_ivec2,
+ slang_spec_ivec3,
+ slang_spec_ivec4,
+ slang_spec_float,
+ slang_spec_vec2,
+ slang_spec_vec3,
+ slang_spec_vec4,
+ slang_spec_mat2,
+ slang_spec_mat3,
+ slang_spec_mat4,
+ slang_spec_sampler1D,
+ slang_spec_sampler2D,
+ slang_spec_sampler3D,
+ slang_spec_samplerCube,
+ slang_spec_sampler1DShadow,
+ slang_spec_sampler2DShadow,
+ slang_spec_struct,
+ slang_spec_array
+} slang_type_specifier_type;
+
+typedef struct slang_type_specifier_
+{
+ slang_type_specifier_type type;
+ struct slang_struct_ *_struct; /* type: spec_struct */
+ struct slang_type_specifier_ *_array; /* type: spec_array */
+} slang_type_specifier;
+
+GLvoid slang_type_specifier_ctr (slang_type_specifier *);
+GLvoid slang_type_specifier_dtr (slang_type_specifier *);
+GLboolean slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);
+GLboolean slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *);
+
+typedef struct slang_assembly_typeinfo_
+{
+ GLboolean can_be_referenced;
+ GLboolean is_swizzled;
+ slang_swizzle swz;
+ slang_type_specifier spec;
+ GLuint array_len;
+} slang_assembly_typeinfo;
+
+GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);
+GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);
+
+/*
+ * Retrieves type information about an operation.
+ * Returns GL_TRUE on success.
+ * Returns GL_FALSE otherwise.
+ */
+GLboolean _slang_typeof_operation (slang_assemble_ctx *, struct slang_operation_ *,
+ slang_assembly_typeinfo *);
+GLboolean _slang_typeof_operation_ (struct slang_operation_ *, slang_assembly_name_space *,
+ slang_assembly_typeinfo *, slang_atom_pool *);
+
+/*
+ * Retrieves type of a function prototype, if one exists.
+ * Returns GL_TRUE on success, even if the function was not found.
+ * Returns GL_FALSE otherwise.
+ */
+GLboolean _slang_typeof_function (slang_atom a_name, struct slang_operation_ *params,
+ GLuint num_params, slang_assembly_name_space *, slang_type_specifier *spec, GLboolean *exists,
+ slang_atom_pool *);
+
+GLboolean _slang_type_is_matrix (slang_type_specifier_type);
+
+GLboolean _slang_type_is_vector (slang_type_specifier_type);
+
+slang_type_specifier_type _slang_type_base (slang_type_specifier_type);
+
+GLuint _slang_type_dim (slang_type_specifier_type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
*/
#if !defined SLANG_COMPILE_H
-#define SLANG_COMPILE_H\r
-\r
-#include "slang_export.h"\r
-#include "slang_execute.h"\r
-#include "slang_compile_variable.h"\r
-#include "slang_compile_struct.h"\r
-#include "slang_compile_operation.h"\r
+#define SLANG_COMPILE_H
+
+#include "slang_export.h"
+#include "slang_execute.h"
+#include "slang_compile_variable.h"
+#include "slang_compile_struct.h"
+#include "slang_compile_operation.h"
#include "slang_compile_function.h"
#if defined __cplusplus
slang_unit_vertex_shader,
slang_unit_fragment_builtin,
slang_unit_vertex_builtin
-} slang_unit_type;\r
-\r
-typedef struct slang_var_pool_\r
-{\r
- GLuint next_addr;\r
-} slang_var_pool;\r
-\r
+} slang_unit_type;
+
+typedef struct slang_var_pool_
+{
+ GLuint next_addr;
+} slang_var_pool;
+
typedef struct slang_translation_unit_
{
slang_variable_scope globals;
slang_function_scope functions;
slang_struct_scope structs;
- slang_unit_type type;\r
- slang_assembly_file *assembly;\r
- int free_assembly;\r
- slang_var_pool *global_pool;\r
- int free_global_pool;\r
- slang_machine *machine;\r
- int free_machine;\r
- slang_atom_pool *atom_pool;\r
- int free_atom_pool;\r
- slang_export_data_table exp_data;\r
+ slang_unit_type type;
+ slang_assembly_file *assembly;
+ int free_assembly;
+ slang_var_pool *global_pool;
+ int free_global_pool;
+ slang_machine *machine;
+ int free_machine;
+ slang_atom_pool *atom_pool;
+ int free_atom_pool;
+ slang_export_data_table exp_data;
slang_export_code_table exp_code;
} slang_translation_unit;
-int slang_translation_unit_construct (slang_translation_unit *);\r
-int slang_translation_unit_construct2 (slang_translation_unit *, slang_assembly_file *,\r
+int slang_translation_unit_construct (slang_translation_unit *);
+int slang_translation_unit_construct2 (slang_translation_unit *, slang_assembly_file *,
slang_var_pool *, slang_machine *, slang_atom_pool *);
void slang_translation_unit_destruct (slang_translation_unit *);
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_compile_function.c\r
- * slang front-end compiler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_compile.h"\r
-\r
-/* slang_fixup_table */\r
-\r
-void slang_fixup_table_init (slang_fixup_table *fix)\r
-{\r
- fix->table = NULL;\r
- fix->count = 0;\r
-}\r
-\r
-void slang_fixup_table_free (slang_fixup_table *fix)\r
-{\r
- slang_alloc_free (fix->table);\r
- slang_fixup_table_init (fix);\r
-}\r
-\r
-/* slang_function */\r
-\r
-int slang_function_construct (slang_function *func)\r
-{\r
- func->kind = slang_func_ordinary;\r
- if (!slang_variable_construct (&func->header))\r
- return 0;\r
- func->parameters = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));\r
- if (func->parameters == NULL)\r
- {\r
- slang_variable_destruct (&func->header);\r
- return 0;\r
- }\r
- if (!slang_variable_scope_construct (func->parameters))\r
- {\r
- slang_alloc_free (func->parameters);\r
- slang_variable_destruct (&func->header);\r
- return 0;\r
- }\r
- func->param_count = 0;\r
- func->body = NULL;\r
- func->address = ~0;\r
- slang_fixup_table_init (&func->fixups);\r
- return 1;\r
-}\r
-\r
-void slang_function_destruct (slang_function *func)\r
-{\r
- slang_variable_destruct (&func->header);\r
- slang_variable_scope_destruct (func->parameters);\r
- slang_alloc_free (func->parameters);\r
- if (func->body != NULL)\r
- {\r
- slang_operation_destruct (func->body);\r
- slang_alloc_free (func->body);\r
- }\r
- slang_fixup_table_free (&func->fixups);\r
-}\r
-\r
-/* slang_function_scope */\r
-\r
-int slang_function_scope_construct (slang_function_scope *scope)\r
-{\r
- scope->functions = NULL;\r
- scope->num_functions = 0;\r
- scope->outer_scope = NULL;\r
- return 1;\r
-}\r
-\r
-void slang_function_scope_destruct (slang_function_scope *scope)\r
-{\r
- unsigned int i;\r
-\r
- for (i = 0; i < scope->num_functions; i++)\r
- slang_function_destruct (scope->functions + i);\r
- slang_alloc_free (scope->functions);\r
-}\r
-\r
-int slang_function_scope_find_by_name (slang_function_scope *funcs, slang_atom a_name, int all_scopes)\r
-{\r
- unsigned int i;\r
-\r
- for (i = 0; i < funcs->num_functions; i++)\r
- if (a_name == funcs->functions[i].header.a_name)\r
- return 1;\r
- if (all_scopes && funcs->outer_scope != NULL)\r
- return slang_function_scope_find_by_name (funcs->outer_scope, a_name, 1);\r
- return 0;\r
-}\r
-\r
-slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_function *fun,\r
- int all_scopes)\r
-{\r
- unsigned int i;\r
-\r
- for (i = 0; i < funcs->num_functions; i++)\r
- {\r
- slang_function *f = &funcs->functions[i];\r
- unsigned int j;\r
-\r
- if (fun->header.a_name != f->header.a_name)\r
- continue;\r
- if (fun->param_count != f->param_count)\r
- continue;\r
- for (j = 0; j < fun->param_count; j++)\r
- {\r
- if (!slang_type_specifier_equal (&fun->parameters->variables[j].type.specifier,\r
- &f->parameters->variables[j].type.specifier))\r
- break;\r
- }\r
- if (j == fun->param_count)\r
- return f;\r
- }\r
- if (all_scopes && funcs->outer_scope != NULL)\r
- return slang_function_scope_find (funcs->outer_scope, fun, 1);\r
- return NULL;\r
-}\r
-\r
-/*\r
- * _slang_build_export_code_table()\r
- */\r
-\r
-GLboolean _slang_build_export_code_table (slang_export_code_table *tbl, slang_function_scope *funs,\r
- slang_translation_unit *unit)\r
-{\r
- slang_atom mainAtom;\r
- GLuint i;\r
-\r
- mainAtom = slang_atom_pool_atom (tbl->atoms, "main");\r
- if (mainAtom == SLANG_ATOM_NULL)\r
- return GL_FALSE;\r
-\r
- for (i = 0; i < funs->num_functions; i++)\r
- {\r
- if (funs->functions[i].header.a_name == mainAtom)\r
- {\r
- slang_function *fun = &funs->functions[i];\r
- slang_export_code_entry *e;\r
- slang_assemble_ctx A;\r
-\r
- e = slang_export_code_table_add (tbl);\r
- if (e == NULL)\r
- return GL_FALSE;\r
- e->address = unit->assembly->count;\r
- e->name = slang_atom_pool_atom (tbl->atoms, "@main");\r
- if (e->name == SLANG_ATOM_NULL)\r
- return GL_FALSE;\r
-\r
- A.file = unit->assembly;\r
- A.mach = unit->machine;\r
- A.atoms = unit->atom_pool;\r
- A.space.funcs = &unit->functions;\r
- A.space.structs = &unit->structs;\r
- A.space.vars = &unit->globals;\r
- slang_assembly_file_push_label (unit->assembly, slang_asm_local_alloc, 20);\r
- slang_assembly_file_push_label (unit->assembly, slang_asm_enter, 20);\r
- _slang_assemble_function_call (&A, fun, NULL, 0, GL_FALSE);\r
- slang_assembly_file_push (unit->assembly, slang_asm_exit);\r
- }\r
- }\r
- return GL_TRUE;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_compile_function.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_fixup_table */
+
+void slang_fixup_table_init (slang_fixup_table *fix)
+{
+ fix->table = NULL;
+ fix->count = 0;
+}
+
+void slang_fixup_table_free (slang_fixup_table *fix)
+{
+ slang_alloc_free (fix->table);
+ slang_fixup_table_init (fix);
+}
+
+/* slang_function */
+
+int slang_function_construct (slang_function *func)
+{
+ func->kind = slang_func_ordinary;
+ if (!slang_variable_construct (&func->header))
+ return 0;
+ func->parameters = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
+ if (func->parameters == NULL)
+ {
+ slang_variable_destruct (&func->header);
+ return 0;
+ }
+ if (!slang_variable_scope_construct (func->parameters))
+ {
+ slang_alloc_free (func->parameters);
+ slang_variable_destruct (&func->header);
+ return 0;
+ }
+ func->param_count = 0;
+ func->body = NULL;
+ func->address = ~0;
+ slang_fixup_table_init (&func->fixups);
+ return 1;
+}
+
+void slang_function_destruct (slang_function *func)
+{
+ slang_variable_destruct (&func->header);
+ slang_variable_scope_destruct (func->parameters);
+ slang_alloc_free (func->parameters);
+ if (func->body != NULL)
+ {
+ slang_operation_destruct (func->body);
+ slang_alloc_free (func->body);
+ }
+ slang_fixup_table_free (&func->fixups);
+}
+
+/* slang_function_scope */
+
+int slang_function_scope_construct (slang_function_scope *scope)
+{
+ scope->functions = NULL;
+ scope->num_functions = 0;
+ scope->outer_scope = NULL;
+ return 1;
+}
+
+void slang_function_scope_destruct (slang_function_scope *scope)
+{
+ unsigned int i;
+
+ for (i = 0; i < scope->num_functions; i++)
+ slang_function_destruct (scope->functions + i);
+ slang_alloc_free (scope->functions);
+}
+
+int slang_function_scope_find_by_name (slang_function_scope *funcs, slang_atom a_name, int all_scopes)
+{
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++)
+ if (a_name == funcs->functions[i].header.a_name)
+ return 1;
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find_by_name (funcs->outer_scope, a_name, 1);
+ return 0;
+}
+
+slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_function *fun,
+ int all_scopes)
+{
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++)
+ {
+ slang_function *f = &funcs->functions[i];
+ unsigned int j;
+
+ if (fun->header.a_name != f->header.a_name)
+ continue;
+ if (fun->param_count != f->param_count)
+ continue;
+ for (j = 0; j < fun->param_count; j++)
+ {
+ if (!slang_type_specifier_equal (&fun->parameters->variables[j].type.specifier,
+ &f->parameters->variables[j].type.specifier))
+ break;
+ }
+ if (j == fun->param_count)
+ return f;
+ }
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find (funcs->outer_scope, fun, 1);
+ return NULL;
+}
+
+/*
+ * _slang_build_export_code_table()
+ */
+
+GLboolean _slang_build_export_code_table (slang_export_code_table *tbl, slang_function_scope *funs,
+ slang_translation_unit *unit)
+{
+ slang_atom mainAtom;
+ GLuint i;
+
+ mainAtom = slang_atom_pool_atom (tbl->atoms, "main");
+ if (mainAtom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < funs->num_functions; i++)
+ {
+ if (funs->functions[i].header.a_name == mainAtom)
+ {
+ slang_function *fun = &funs->functions[i];
+ slang_export_code_entry *e;
+ slang_assemble_ctx A;
+
+ e = slang_export_code_table_add (tbl);
+ if (e == NULL)
+ return GL_FALSE;
+ e->address = unit->assembly->count;
+ e->name = slang_atom_pool_atom (tbl->atoms, "@main");
+ if (e->name == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ A.file = unit->assembly;
+ A.mach = unit->machine;
+ A.atoms = unit->atom_pool;
+ A.space.funcs = &unit->functions;
+ A.space.structs = &unit->structs;
+ A.space.vars = &unit->globals;
+ slang_assembly_file_push_label (unit->assembly, slang_asm_local_alloc, 20);
+ slang_assembly_file_push_label (unit->assembly, slang_asm_enter, 20);
+ _slang_assemble_function_call (&A, fun, NULL, 0, GL_FALSE);
+ slang_assembly_file_push (unit->assembly, slang_asm_exit);
+ }
+ }
+ return GL_TRUE;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_COMPILE_FUNCTION_H\r
-#define SLANG_COMPILE_FUNCTION_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-struct slang_translation_unit_;\r
-\r
-typedef enum slang_function_kind_\r
-{\r
- slang_func_ordinary,\r
- slang_func_constructor,\r
- slang_func_operator\r
-} slang_function_kind;\r
-\r
-typedef struct slang_fixup_table_\r
-{\r
- GLuint *table;\r
- GLuint count;\r
-} slang_fixup_table;\r
-\r
-void slang_fixup_table_init (slang_fixup_table *);\r
-void slang_fixup_table_free (slang_fixup_table *);\r
-\r
-typedef struct slang_function_\r
-{\r
- slang_function_kind kind;\r
- slang_variable header;\r
- slang_variable_scope *parameters;\r
- unsigned int param_count;\r
- slang_operation *body;\r
- unsigned int address;\r
- slang_fixup_table fixups;\r
-} slang_function;\r
-\r
-int slang_function_construct (slang_function *);\r
-void slang_function_destruct (slang_function *);\r
-\r
-typedef struct slang_function_scope_\r
-{\r
- slang_function *functions;\r
- unsigned int num_functions;\r
- struct slang_function_scope_ *outer_scope;\r
-} slang_function_scope;\r
-\r
-int slang_function_scope_construct (slang_function_scope *);\r
-void slang_function_scope_destruct (slang_function_scope *);\r
-int slang_function_scope_find_by_name (slang_function_scope *, slang_atom, int);\r
-slang_function *slang_function_scope_find (slang_function_scope *, slang_function *, int);\r
-\r
-GLboolean _slang_build_export_code_table (slang_export_code_table *, slang_function_scope *,\r
- struct slang_translation_unit_ *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_COMPILE_FUNCTION_H
+#define SLANG_COMPILE_FUNCTION_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+struct slang_translation_unit_;
+
+typedef enum slang_function_kind_
+{
+ slang_func_ordinary,
+ slang_func_constructor,
+ slang_func_operator
+} slang_function_kind;
+
+typedef struct slang_fixup_table_
+{
+ GLuint *table;
+ GLuint count;
+} slang_fixup_table;
+
+void slang_fixup_table_init (slang_fixup_table *);
+void slang_fixup_table_free (slang_fixup_table *);
+
+typedef struct slang_function_
+{
+ slang_function_kind kind;
+ slang_variable header;
+ slang_variable_scope *parameters;
+ unsigned int param_count;
+ slang_operation *body;
+ unsigned int address;
+ slang_fixup_table fixups;
+} slang_function;
+
+int slang_function_construct (slang_function *);
+void slang_function_destruct (slang_function *);
+
+typedef struct slang_function_scope_
+{
+ slang_function *functions;
+ unsigned int num_functions;
+ struct slang_function_scope_ *outer_scope;
+} slang_function_scope;
+
+int slang_function_scope_construct (slang_function_scope *);
+void slang_function_scope_destruct (slang_function_scope *);
+int slang_function_scope_find_by_name (slang_function_scope *, slang_atom, int);
+slang_function *slang_function_scope_find (slang_function_scope *, slang_function *, int);
+
+GLboolean _slang_build_export_code_table (slang_export_code_table *, slang_function_scope *,
+ struct slang_translation_unit_ *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_compile_operation.c\r
- * slang front-end compiler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_compile.h"\r
-\r
-/* slang_operation */\r
-\r
-int slang_operation_construct (slang_operation *oper)\r
-{\r
- oper->type = slang_oper_none;\r
- oper->children = NULL;\r
- oper->num_children = 0;\r
- oper->literal = (float) 0;\r
- oper->a_id = SLANG_ATOM_NULL;\r
- oper->locals = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));\r
- if (oper->locals == NULL)\r
- return 0;\r
- if (!slang_variable_scope_construct (oper->locals))\r
- {\r
- slang_alloc_free (oper->locals);\r
- return 0;\r
- }\r
- return 1;\r
-}\r
-\r
-void slang_operation_destruct (slang_operation *oper)\r
-{\r
- unsigned int i;\r
-\r
- for (i = 0; i < oper->num_children; i++)\r
- slang_operation_destruct (oper->children + i);\r
- slang_alloc_free (oper->children);\r
- slang_variable_scope_destruct (oper->locals);\r
- slang_alloc_free (oper->locals);\r
-}\r
-\r
-int slang_operation_copy (slang_operation *x, const slang_operation *y)\r
-{\r
- slang_operation z;\r
- unsigned int i;\r
-\r
- if (!slang_operation_construct (&z))\r
- return 0;\r
- z.type = y->type;\r
- z.children = (slang_operation *) slang_alloc_malloc (y->num_children * sizeof (slang_operation));\r
- if (z.children == NULL)\r
- {\r
- slang_operation_destruct (&z);\r
- return 0;\r
- }\r
- for (z.num_children = 0; z.num_children < y->num_children; z.num_children++)\r
- if (!slang_operation_construct (&z.children[z.num_children]))\r
- {\r
- slang_operation_destruct (&z);\r
- return 0;\r
- }\r
- for (i = 0; i < z.num_children; i++)\r
- if (!slang_operation_copy (&z.children[i], &y->children[i]))\r
- {\r
- slang_operation_destruct (&z);\r
- return 0;\r
- }\r
- z.literal = y->literal;\r
- z.a_id = y->a_id;\r
- if (!slang_variable_scope_copy (z.locals, y->locals))\r
- {\r
- slang_operation_destruct (&z);\r
- return 0;\r
- }\r
- slang_operation_destruct (x);\r
- *x = z;\r
- return 1;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_compile_operation.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_operation */
+
+int slang_operation_construct (slang_operation *oper)
+{
+ oper->type = slang_oper_none;
+ oper->children = NULL;
+ oper->num_children = 0;
+ oper->literal = (float) 0;
+ oper->a_id = SLANG_ATOM_NULL;
+ oper->locals = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
+ if (oper->locals == NULL)
+ return 0;
+ if (!slang_variable_scope_construct (oper->locals))
+ {
+ slang_alloc_free (oper->locals);
+ return 0;
+ }
+ return 1;
+}
+
+void slang_operation_destruct (slang_operation *oper)
+{
+ unsigned int i;
+
+ for (i = 0; i < oper->num_children; i++)
+ slang_operation_destruct (oper->children + i);
+ slang_alloc_free (oper->children);
+ slang_variable_scope_destruct (oper->locals);
+ slang_alloc_free (oper->locals);
+}
+
+int slang_operation_copy (slang_operation *x, const slang_operation *y)
+{
+ slang_operation z;
+ unsigned int i;
+
+ if (!slang_operation_construct (&z))
+ return 0;
+ z.type = y->type;
+ z.children = (slang_operation *) slang_alloc_malloc (y->num_children * sizeof (slang_operation));
+ if (z.children == NULL)
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ for (z.num_children = 0; z.num_children < y->num_children; z.num_children++)
+ if (!slang_operation_construct (&z.children[z.num_children]))
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ for (i = 0; i < z.num_children; i++)
+ if (!slang_operation_copy (&z.children[i], &y->children[i]))
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ z.literal = y->literal;
+ z.a_id = y->a_id;
+ if (!slang_variable_scope_copy (z.locals, y->locals))
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ slang_operation_destruct (x);
+ *x = z;
+ return 1;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_COMPILE_OPERATION_H\r
-#define SLANG_COMPILE_OPERATION_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef enum slang_operation_type_\r
-{\r
- slang_oper_none,\r
- slang_oper_block_no_new_scope,\r
- slang_oper_block_new_scope,\r
- slang_oper_variable_decl,\r
- slang_oper_asm,\r
- slang_oper_break,\r
- slang_oper_continue,\r
- slang_oper_discard,\r
- slang_oper_return,\r
- slang_oper_expression,\r
- slang_oper_if,\r
- slang_oper_while,\r
- slang_oper_do,\r
- slang_oper_for,\r
- slang_oper_void,\r
- slang_oper_literal_bool,\r
- slang_oper_literal_int,\r
- slang_oper_literal_float,\r
- slang_oper_identifier,\r
- slang_oper_sequence,\r
- slang_oper_assign,\r
- slang_oper_addassign,\r
- slang_oper_subassign,\r
- slang_oper_mulassign,\r
- slang_oper_divassign,\r
- /*slang_oper_modassign,*/\r
- /*slang_oper_lshassign,*/\r
- /*slang_oper_rshassign,*/\r
- /*slang_oper_orassign,*/\r
- /*slang_oper_xorassign,*/\r
- /*slang_oper_andassign,*/\r
- slang_oper_select,\r
- slang_oper_logicalor,\r
- slang_oper_logicalxor,\r
- slang_oper_logicaland,\r
- /*slang_oper_bitor,*/\r
- /*slang_oper_bitxor,*/\r
- /*slang_oper_bitand,*/\r
- slang_oper_equal,\r
- slang_oper_notequal,\r
- slang_oper_less,\r
- slang_oper_greater,\r
- slang_oper_lessequal,\r
- slang_oper_greaterequal,\r
- /*slang_oper_lshift,*/\r
- /*slang_oper_rshift,*/\r
- slang_oper_add,\r
- slang_oper_subtract,\r
- slang_oper_multiply,\r
- slang_oper_divide,\r
- /*slang_oper_modulus,*/\r
- slang_oper_preincrement,\r
- slang_oper_predecrement,\r
- slang_oper_plus,\r
- slang_oper_minus,\r
- /*slang_oper_complement,*/\r
- slang_oper_not,\r
- slang_oper_subscript,\r
- slang_oper_call,\r
- slang_oper_field,\r
- slang_oper_postincrement,\r
- slang_oper_postdecrement\r
-} slang_operation_type;\r
-\r
-typedef struct slang_operation_\r
-{\r
- slang_operation_type type;\r
- struct slang_operation_ *children;\r
- unsigned int num_children;\r
- float literal; /* type: bool, literal_int, literal_float */\r
- slang_atom a_id; /* type: asm, identifier, call, field */\r
- slang_variable_scope *locals;\r
-} slang_operation;\r
-\r
-int slang_operation_construct (slang_operation *);\r
-void slang_operation_destruct (slang_operation *);\r
-int slang_operation_copy (slang_operation *, const slang_operation *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_COMPILE_OPERATION_H
+#define SLANG_COMPILE_OPERATION_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef enum slang_operation_type_
+{
+ slang_oper_none,
+ slang_oper_block_no_new_scope,
+ slang_oper_block_new_scope,
+ slang_oper_variable_decl,
+ slang_oper_asm,
+ slang_oper_break,
+ slang_oper_continue,
+ slang_oper_discard,
+ slang_oper_return,
+ slang_oper_expression,
+ slang_oper_if,
+ slang_oper_while,
+ slang_oper_do,
+ slang_oper_for,
+ slang_oper_void,
+ slang_oper_literal_bool,
+ slang_oper_literal_int,
+ slang_oper_literal_float,
+ slang_oper_identifier,
+ slang_oper_sequence,
+ slang_oper_assign,
+ slang_oper_addassign,
+ slang_oper_subassign,
+ slang_oper_mulassign,
+ slang_oper_divassign,
+ /*slang_oper_modassign,*/
+ /*slang_oper_lshassign,*/
+ /*slang_oper_rshassign,*/
+ /*slang_oper_orassign,*/
+ /*slang_oper_xorassign,*/
+ /*slang_oper_andassign,*/
+ slang_oper_select,
+ slang_oper_logicalor,
+ slang_oper_logicalxor,
+ slang_oper_logicaland,
+ /*slang_oper_bitor,*/
+ /*slang_oper_bitxor,*/
+ /*slang_oper_bitand,*/
+ slang_oper_equal,
+ slang_oper_notequal,
+ slang_oper_less,
+ slang_oper_greater,
+ slang_oper_lessequal,
+ slang_oper_greaterequal,
+ /*slang_oper_lshift,*/
+ /*slang_oper_rshift,*/
+ slang_oper_add,
+ slang_oper_subtract,
+ slang_oper_multiply,
+ slang_oper_divide,
+ /*slang_oper_modulus,*/
+ slang_oper_preincrement,
+ slang_oper_predecrement,
+ slang_oper_plus,
+ slang_oper_minus,
+ /*slang_oper_complement,*/
+ slang_oper_not,
+ slang_oper_subscript,
+ slang_oper_call,
+ slang_oper_field,
+ slang_oper_postincrement,
+ slang_oper_postdecrement
+} slang_operation_type;
+
+typedef struct slang_operation_
+{
+ slang_operation_type type;
+ struct slang_operation_ *children;
+ unsigned int num_children;
+ float literal; /* type: bool, literal_int, literal_float */
+ slang_atom a_id; /* type: asm, identifier, call, field */
+ slang_variable_scope *locals;
+} slang_operation;
+
+int slang_operation_construct (slang_operation *);
+void slang_operation_destruct (slang_operation *);
+int slang_operation_copy (slang_operation *, const slang_operation *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_compile_struct.c\r
- * slang front-end compiler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_compile.h"\r
-\r
-/* slang_struct_scope */\r
-\r
-int slang_struct_scope_construct (slang_struct_scope *scope)\r
-{\r
- scope->structs = NULL;\r
- scope->num_structs = 0;\r
- scope->outer_scope = NULL;\r
- return 1;\r
-}\r
-\r
-void slang_struct_scope_destruct (slang_struct_scope *scope)\r
-{\r
- unsigned int i;\r
-\r
- for (i = 0; i < scope->num_structs; i++)\r
- slang_struct_destruct (scope->structs + i);\r
- slang_alloc_free (scope->structs);\r
- /* do not free scope->outer_scope */\r
-}\r
-\r
-int slang_struct_scope_copy (slang_struct_scope *x, const slang_struct_scope *y)\r
-{\r
- slang_struct_scope z;\r
- unsigned int i;\r
-\r
- if (!slang_struct_scope_construct (&z))\r
- return 0;\r
- z.structs = (slang_struct *) slang_alloc_malloc (y->num_structs * sizeof (slang_struct));\r
- if (z.structs == NULL)\r
- {\r
- slang_struct_scope_destruct (&z);\r
- return 0;\r
- }\r
- for (z.num_structs = 0; z.num_structs < y->num_structs; z.num_structs++)\r
- if (!slang_struct_construct (&z.structs[z.num_structs]))\r
- {\r
- slang_struct_scope_destruct (&z);\r
- return 0;\r
- }\r
- for (i = 0; i < z.num_structs; i++)\r
- if (!slang_struct_copy (&z.structs[i], &y->structs[i]))\r
- {\r
- slang_struct_scope_destruct (&z);\r
- return 0;\r
- }\r
- z.outer_scope = y->outer_scope;\r
- slang_struct_scope_destruct (x);\r
- *x = z;\r
- return 1;\r
-}\r
-\r
-slang_struct *slang_struct_scope_find (slang_struct_scope *stru, slang_atom a_name, int all_scopes)\r
-{\r
- unsigned int i;\r
-\r
- for (i = 0; i < stru->num_structs; i++)\r
- if (a_name == stru->structs[i].a_name)\r
- return &stru->structs[i];\r
- if (all_scopes && stru->outer_scope != NULL)\r
- return slang_struct_scope_find (stru->outer_scope, a_name, 1);\r
- return NULL;\r
-}\r
-\r
-/* slang_struct */\r
-\r
-int slang_struct_construct (slang_struct *stru)\r
-{\r
- stru->a_name = SLANG_ATOM_NULL;\r
- stru->fields = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));\r
- if (stru->fields == NULL)\r
- return 0;\r
- if (!slang_variable_scope_construct (stru->fields))\r
- {\r
- slang_alloc_free (stru->fields);\r
- return 0;\r
- }\r
- stru->structs = (slang_struct_scope *) slang_alloc_malloc (sizeof (slang_struct_scope));\r
- if (stru->structs == NULL)\r
- {\r
- slang_variable_scope_destruct (stru->fields);\r
- slang_alloc_free (stru->fields);\r
- return 0;\r
- }\r
- if (!slang_struct_scope_construct (stru->structs))\r
- {\r
- slang_variable_scope_destruct (stru->fields);\r
- slang_alloc_free (stru->fields);\r
- slang_alloc_free (stru->structs);\r
- return 0;\r
- }\r
- return 1;\r
-}\r
-\r
-void slang_struct_destruct (slang_struct *stru)\r
-{\r
- slang_variable_scope_destruct (stru->fields);\r
- slang_alloc_free (stru->fields);\r
- slang_struct_scope_destruct (stru->structs);\r
- slang_alloc_free (stru->structs);\r
-}\r
-\r
-int slang_struct_copy (slang_struct *x, const slang_struct *y)\r
-{\r
- slang_struct z;\r
-\r
- if (!slang_struct_construct (&z))\r
- return 0;\r
- z.a_name = y->a_name;\r
- if (!slang_variable_scope_copy (z.fields, y->fields))\r
- {\r
- slang_struct_destruct (&z);\r
- return 0;\r
- }\r
- if (!slang_struct_scope_copy (z.structs, y->structs))\r
- {\r
- slang_struct_destruct (&z);\r
- return 0;\r
- }\r
- slang_struct_destruct (x);\r
- *x = z;\r
- return 1;\r
-}\r
-\r
-int slang_struct_equal (const slang_struct *x, const slang_struct *y)\r
-{\r
- unsigned int i;\r
-\r
- if (x->fields->num_variables != y->fields->num_variables)\r
- return 0;\r
- for (i = 0; i < x->fields->num_variables; i++)\r
- {\r
- slang_variable *varx = &x->fields->variables[i];\r
- slang_variable *vary = &y->fields->variables[i];\r
-\r
- if (varx->a_name != vary->a_name)\r
- return 0;\r
- if (!slang_type_specifier_equal (&varx->type.specifier, &vary->type.specifier))\r
- return 0;\r
- if (varx->type.specifier.type == slang_spec_array)\r
- if (varx->array_len != vary->array_len)\r
- return GL_FALSE;\r
- }\r
- return 1;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_compile_struct.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_struct_scope */
+
+int slang_struct_scope_construct (slang_struct_scope *scope)
+{
+ scope->structs = NULL;
+ scope->num_structs = 0;
+ scope->outer_scope = NULL;
+ return 1;
+}
+
+void slang_struct_scope_destruct (slang_struct_scope *scope)
+{
+ unsigned int i;
+
+ for (i = 0; i < scope->num_structs; i++)
+ slang_struct_destruct (scope->structs + i);
+ slang_alloc_free (scope->structs);
+ /* do not free scope->outer_scope */
+}
+
+int slang_struct_scope_copy (slang_struct_scope *x, const slang_struct_scope *y)
+{
+ slang_struct_scope z;
+ unsigned int i;
+
+ if (!slang_struct_scope_construct (&z))
+ return 0;
+ z.structs = (slang_struct *) slang_alloc_malloc (y->num_structs * sizeof (slang_struct));
+ if (z.structs == NULL)
+ {
+ slang_struct_scope_destruct (&z);
+ return 0;
+ }
+ for (z.num_structs = 0; z.num_structs < y->num_structs; z.num_structs++)
+ if (!slang_struct_construct (&z.structs[z.num_structs]))
+ {
+ slang_struct_scope_destruct (&z);
+ return 0;
+ }
+ for (i = 0; i < z.num_structs; i++)
+ if (!slang_struct_copy (&z.structs[i], &y->structs[i]))
+ {
+ slang_struct_scope_destruct (&z);
+ return 0;
+ }
+ z.outer_scope = y->outer_scope;
+ slang_struct_scope_destruct (x);
+ *x = z;
+ return 1;
+}
+
+slang_struct *slang_struct_scope_find (slang_struct_scope *stru, slang_atom a_name, int all_scopes)
+{
+ unsigned int i;
+
+ for (i = 0; i < stru->num_structs; i++)
+ if (a_name == stru->structs[i].a_name)
+ return &stru->structs[i];
+ if (all_scopes && stru->outer_scope != NULL)
+ return slang_struct_scope_find (stru->outer_scope, a_name, 1);
+ return NULL;
+}
+
+/* slang_struct */
+
+int slang_struct_construct (slang_struct *stru)
+{
+ stru->a_name = SLANG_ATOM_NULL;
+ stru->fields = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
+ if (stru->fields == NULL)
+ return 0;
+ if (!slang_variable_scope_construct (stru->fields))
+ {
+ slang_alloc_free (stru->fields);
+ return 0;
+ }
+ stru->structs = (slang_struct_scope *) slang_alloc_malloc (sizeof (slang_struct_scope));
+ if (stru->structs == NULL)
+ {
+ slang_variable_scope_destruct (stru->fields);
+ slang_alloc_free (stru->fields);
+ return 0;
+ }
+ if (!slang_struct_scope_construct (stru->structs))
+ {
+ slang_variable_scope_destruct (stru->fields);
+ slang_alloc_free (stru->fields);
+ slang_alloc_free (stru->structs);
+ return 0;
+ }
+ return 1;
+}
+
+void slang_struct_destruct (slang_struct *stru)
+{
+ slang_variable_scope_destruct (stru->fields);
+ slang_alloc_free (stru->fields);
+ slang_struct_scope_destruct (stru->structs);
+ slang_alloc_free (stru->structs);
+}
+
+int slang_struct_copy (slang_struct *x, const slang_struct *y)
+{
+ slang_struct z;
+
+ if (!slang_struct_construct (&z))
+ return 0;
+ z.a_name = y->a_name;
+ if (!slang_variable_scope_copy (z.fields, y->fields))
+ {
+ slang_struct_destruct (&z);
+ return 0;
+ }
+ if (!slang_struct_scope_copy (z.structs, y->structs))
+ {
+ slang_struct_destruct (&z);
+ return 0;
+ }
+ slang_struct_destruct (x);
+ *x = z;
+ return 1;
+}
+
+int slang_struct_equal (const slang_struct *x, const slang_struct *y)
+{
+ unsigned int i;
+
+ if (x->fields->num_variables != y->fields->num_variables)
+ return 0;
+ for (i = 0; i < x->fields->num_variables; i++)
+ {
+ slang_variable *varx = &x->fields->variables[i];
+ slang_variable *vary = &y->fields->variables[i];
+
+ if (varx->a_name != vary->a_name)
+ return 0;
+ if (!slang_type_specifier_equal (&varx->type.specifier, &vary->type.specifier))
+ return 0;
+ if (varx->type.specifier.type == slang_spec_array)
+ if (varx->array_len != vary->array_len)
+ return GL_FALSE;
+ }
+ return 1;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_COMPILE_STRUCT_H\r
-#define SLANG_COMPILE_STRUCT_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef struct slang_struct_scope_\r
-{\r
- struct slang_struct_ *structs;\r
- unsigned int num_structs;\r
- struct slang_struct_scope_ *outer_scope;\r
-} slang_struct_scope;\r
-\r
-int slang_struct_scope_construct (slang_struct_scope *);\r
-void slang_struct_scope_destruct (slang_struct_scope *);\r
-int slang_struct_scope_copy (slang_struct_scope *, const slang_struct_scope *);\r
-struct slang_struct_ *slang_struct_scope_find (slang_struct_scope *, slang_atom, int);\r
-\r
-typedef struct slang_struct_\r
-{\r
- slang_atom a_name;\r
- struct slang_variable_scope_ *fields;\r
- slang_struct_scope *structs;\r
-} slang_struct;\r
-\r
-int slang_struct_construct (slang_struct *);\r
-void slang_struct_destruct (slang_struct *);\r
-int slang_struct_copy (slang_struct *, const slang_struct *);\r
-int slang_struct_equal (const slang_struct *, const slang_struct *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_COMPILE_STRUCT_H
+#define SLANG_COMPILE_STRUCT_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef struct slang_struct_scope_
+{
+ struct slang_struct_ *structs;
+ unsigned int num_structs;
+ struct slang_struct_scope_ *outer_scope;
+} slang_struct_scope;
+
+int slang_struct_scope_construct (slang_struct_scope *);
+void slang_struct_scope_destruct (slang_struct_scope *);
+int slang_struct_scope_copy (slang_struct_scope *, const slang_struct_scope *);
+struct slang_struct_ *slang_struct_scope_find (slang_struct_scope *, slang_atom, int);
+
+typedef struct slang_struct_
+{
+ slang_atom a_name;
+ struct slang_variable_scope_ *fields;
+ slang_struct_scope *structs;
+} slang_struct;
+
+int slang_struct_construct (slang_struct *);
+void slang_struct_destruct (slang_struct *);
+int slang_struct_copy (slang_struct *, const slang_struct *);
+int slang_struct_equal (const slang_struct *, const slang_struct *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_compile_variable.c\r
- * slang front-end compiler\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_compile.h"\r
-\r
-/* slang_type_specifier_type */\r
-\r
-typedef struct\r
-{\r
- const char *name;\r
- slang_type_specifier_type type;\r
-} type_specifier_type_name;\r
-\r
-static type_specifier_type_name type_specifier_type_names[] = {\r
- { "void", slang_spec_void },\r
- { "bool", slang_spec_bool },\r
- { "bvec2", slang_spec_bvec2 },\r
- { "bvec3", slang_spec_bvec3 },\r
- { "bvec4", slang_spec_bvec4 },\r
- { "int", slang_spec_int },\r
- { "ivec2", slang_spec_ivec2 },\r
- { "ivec3", slang_spec_ivec3 },\r
- { "ivec4", slang_spec_ivec4 },\r
- { "float", slang_spec_float },\r
- { "vec2", slang_spec_vec2 },\r
- { "vec3", slang_spec_vec3 },\r
- { "vec4", slang_spec_vec4 },\r
- { "mat2", slang_spec_mat2 },\r
- { "mat3", slang_spec_mat3 },\r
- { "mat4", slang_spec_mat4 },\r
- { "sampler1D", slang_spec_sampler1D },\r
- { "sampler2D", slang_spec_sampler2D },\r
- { "sampler3D", slang_spec_sampler3D },\r
- { "samplerCube", slang_spec_samplerCube },\r
- { "sampler1DShadow", slang_spec_sampler1DShadow },\r
- { "sampler2DShadow", slang_spec_sampler2DShadow },\r
- { NULL, slang_spec_void }\r
-};\r
-\r
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *name)\r
-{\r
- type_specifier_type_name *p = type_specifier_type_names;\r
- while (p->name != NULL)\r
- {\r
- if (slang_string_compare (p->name, name) == 0)\r
- break;\r
- p++;\r
- }\r
- return p->type;\r
-}\r
-\r
-const char *slang_type_specifier_type_to_string (slang_type_specifier_type type)\r
-{\r
- type_specifier_type_name *p = type_specifier_type_names;\r
- while (p->name != NULL)\r
- {\r
- if (p->type == type)\r
- break;\r
- p++;\r
- }\r
- return p->name;\r
-}\r
-\r
-/* slang_fully_specified_type */\r
-\r
-int slang_fully_specified_type_construct (slang_fully_specified_type *type)\r
-{\r
- type->qualifier = slang_qual_none;\r
- slang_type_specifier_ctr (&type->specifier);\r
- return 1;\r
-}\r
-\r
-void slang_fully_specified_type_destruct (slang_fully_specified_type *type)\r
-{\r
- slang_type_specifier_dtr (&type->specifier);\r
-}\r
-\r
-int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_fully_specified_type *y)\r
-{\r
- slang_fully_specified_type z;\r
-\r
- if (!slang_fully_specified_type_construct (&z))\r
- return 0;\r
- z.qualifier = y->qualifier;\r
- if (!slang_type_specifier_copy (&z.specifier, &y->specifier))\r
- {\r
- slang_fully_specified_type_destruct (&z);\r
- return 0;\r
- }\r
- slang_fully_specified_type_destruct (x);\r
- *x = z;\r
- return 1;\r
-}\r
-\r
-/* slang_variable_scope */\r
-\r
-int slang_variable_scope_construct (slang_variable_scope *scope)\r
-{\r
- scope->variables = NULL;\r
- scope->num_variables = 0;\r
- scope->outer_scope = NULL;\r
- return 1;\r
-}\r
-\r
-void slang_variable_scope_destruct (slang_variable_scope *scope)\r
-{\r
- unsigned int i;\r
-\r
- for (i = 0; i < scope->num_variables; i++)\r
- slang_variable_destruct (scope->variables + i);\r
- slang_alloc_free (scope->variables);\r
- /* do not free scope->outer_scope */\r
-}\r
-\r
-int slang_variable_scope_copy (slang_variable_scope *x, const slang_variable_scope *y)\r
-{\r
- slang_variable_scope z;\r
- unsigned int i;\r
-\r
- if (!slang_variable_scope_construct (&z))\r
- return 0;\r
- z.variables = (slang_variable *) slang_alloc_malloc (y->num_variables * sizeof (slang_variable));\r
- if (z.variables == NULL)\r
- {\r
- slang_variable_scope_destruct (&z);\r
- return 0;\r
- }\r
- for (z.num_variables = 0; z.num_variables < y->num_variables; z.num_variables++)\r
- if (!slang_variable_construct (&z.variables[z.num_variables]))\r
- {\r
- slang_variable_scope_destruct (&z);\r
- return 0;\r
- }\r
- for (i = 0; i < z.num_variables; i++)\r
- if (!slang_variable_copy (&z.variables[i], &y->variables[i]))\r
- {\r
- slang_variable_scope_destruct (&z);\r
- return 0;\r
- }\r
- z.outer_scope = y->outer_scope;\r
- slang_variable_scope_destruct (x);\r
- *x = z;\r
- return 1;\r
-}\r
-\r
-/* slang_variable */\r
-\r
-int slang_variable_construct (slang_variable *var)\r
-{\r
- if (!slang_fully_specified_type_construct (&var->type))\r
- return 0;\r
- var->a_name = SLANG_ATOM_NULL;\r
- var->array_len = 0;\r
- var->initializer = NULL;\r
- var->address = ~0;\r
- var->size = 0;\r
- var->global = 0;\r
- return 1;\r
-}\r
-\r
-void slang_variable_destruct (slang_variable *var)\r
-{\r
- slang_fully_specified_type_destruct (&var->type);\r
- if (var->initializer != NULL)\r
- {\r
- slang_operation_destruct (var->initializer);\r
- slang_alloc_free (var->initializer);\r
- }\r
-}\r
-\r
-int slang_variable_copy (slang_variable *x, const slang_variable *y)\r
-{\r
- slang_variable z;\r
-\r
- if (!slang_variable_construct (&z))\r
- return 0;\r
- if (!slang_fully_specified_type_copy (&z.type, &y->type))\r
- {\r
- slang_variable_destruct (&z);\r
- return 0;\r
- }\r
- z.a_name = y->a_name;\r
- z.array_len = y->array_len;\r
- if (y->initializer != NULL)\r
- {\r
- z.initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));\r
- if (z.initializer == NULL)\r
- {\r
- slang_variable_destruct (&z);\r
- return 0;\r
- }\r
- if (!slang_operation_construct (z.initializer))\r
- {\r
- slang_alloc_free (z.initializer);\r
- slang_variable_destruct (&z);\r
- return 0;\r
- }\r
- if (!slang_operation_copy (z.initializer, y->initializer))\r
- {\r
- slang_variable_destruct (&z);\r
- return 0;\r
- }\r
- }\r
- z.address = y->address;\r
- z.size = y->size;\r
- z.global = y->global;\r
- slang_variable_destruct (x);\r
- *x = z;\r
- return 1;\r
-}\r
-\r
-slang_variable *_slang_locate_variable (slang_variable_scope *scope, slang_atom a_name, GLboolean all)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < scope->num_variables; i++)\r
- if (a_name == scope->variables[i].a_name)\r
- return &scope->variables[i];\r
- if (all && scope->outer_scope != NULL)\r
- return _slang_locate_variable (scope->outer_scope, a_name, 1);\r
- return NULL;\r
-}\r
-\r
-/*\r
- * _slang_build_export_data_table()\r
- */\r
-\r
-static GLenum gl_type_from_specifier (const slang_type_specifier *type)\r
-{\r
- switch (type->type)\r
- {\r
- case slang_spec_bool:\r
- return GL_BOOL_ARB;\r
- case slang_spec_bvec2:\r
- return GL_BOOL_VEC2_ARB;\r
- case slang_spec_bvec3:\r
- return GL_BOOL_VEC3_ARB;\r
- case slang_spec_bvec4:\r
- return GL_BOOL_VEC4_ARB;\r
- case slang_spec_int:\r
- return GL_INT;\r
- case slang_spec_ivec2:\r
- return GL_INT_VEC2_ARB;\r
- case slang_spec_ivec3:\r
- return GL_INT_VEC3_ARB;\r
- case slang_spec_ivec4:\r
- return GL_INT_VEC4_ARB;\r
- case slang_spec_float:\r
- return GL_FLOAT;\r
- case slang_spec_vec2:\r
- return GL_FLOAT_VEC2_ARB;\r
- case slang_spec_vec3:\r
- return GL_FLOAT_VEC3_ARB;\r
- case slang_spec_vec4:\r
- return GL_FLOAT_VEC4_ARB;\r
- case slang_spec_mat2:\r
- return GL_FLOAT_MAT2_ARB;\r
- case slang_spec_mat3:\r
- return GL_FLOAT_MAT3_ARB;\r
- case slang_spec_mat4:\r
- return GL_FLOAT_MAT4_ARB;\r
- case slang_spec_sampler1D:\r
- return GL_SAMPLER_1D_ARB;\r
- case slang_spec_sampler2D:\r
- return GL_SAMPLER_2D_ARB;\r
- case slang_spec_sampler3D:\r
- return GL_SAMPLER_3D_ARB;\r
- case slang_spec_samplerCube:\r
- return GL_SAMPLER_CUBE_ARB;\r
- case slang_spec_sampler1DShadow:\r
- return GL_SAMPLER_1D_SHADOW_ARB;\r
- case slang_spec_sampler2DShadow:\r
- return GL_SAMPLER_2D_SHADOW_ARB;\r
- case slang_spec_array:\r
- return gl_type_from_specifier (type->_array);\r
- default:\r
- return GL_FLOAT;\r
- }\r
-}\r
-\r
-static GLboolean build_quant (slang_export_data_quant *q, slang_variable *var)\r
-{\r
- slang_type_specifier *spec = &var->type.specifier;\r
-\r
- q->name = var->a_name;\r
- q->size = var->size;\r
- if (spec->type == slang_spec_array)\r
- {\r
- q->array_len = var->array_len;\r
- q->size /= var->array_len;\r
- spec = spec->_array;\r
- }\r
- if (spec->type == slang_spec_struct)\r
- {\r
- GLuint i;\r
-\r
- q->u.field_count = spec->_struct->fields->num_variables;\r
- q->structure = (slang_export_data_quant *) slang_alloc_malloc (\r
- q->u.field_count * sizeof (slang_export_data_quant));\r
- if (q->structure == NULL)\r
- return GL_FALSE;\r
-\r
- for (i = 0; i < q->u.field_count; i++)\r
- slang_export_data_quant_ctr (&q->structure[i]);\r
- for (i = 0; i < q->u.field_count; i++)\r
- if (!build_quant (&q->structure[i], &spec->_struct->fields->variables[i]))\r
- return GL_FALSE;\r
- }\r
- else\r
- q->u.basic_type = gl_type_from_specifier (spec);\r
- return GL_TRUE;\r
-}\r
-\r
-GLboolean _slang_build_export_data_table (slang_export_data_table *tbl, slang_variable_scope *vars)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < vars->num_variables; i++)\r
- {\r
- slang_variable *var = &vars->variables[i];\r
- slang_export_data_entry *e;\r
- \r
- e = slang_export_data_table_add (tbl);\r
- if (e == NULL)\r
- return GL_FALSE;\r
- if (!build_quant (&e->quant, var))\r
- return GL_FALSE;\r
- if (var->type.qualifier == slang_qual_uniform)\r
- e->access = slang_exp_uniform;\r
- else if (var->type.qualifier == slang_qual_attribute)\r
- e->access = slang_exp_attribute;\r
- else\r
- e->access = slang_exp_varying;\r
- e->address = var->address;\r
- }\r
-\r
- if (vars->outer_scope != NULL)\r
- return _slang_build_export_data_table (tbl, vars->outer_scope);\r
- return GL_TRUE;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_compile_variable.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_type_specifier_type */
+
+typedef struct
+{
+ const char *name;
+ slang_type_specifier_type type;
+} type_specifier_type_name;
+
+static type_specifier_type_name type_specifier_type_names[] = {
+ { "void", slang_spec_void },
+ { "bool", slang_spec_bool },
+ { "bvec2", slang_spec_bvec2 },
+ { "bvec3", slang_spec_bvec3 },
+ { "bvec4", slang_spec_bvec4 },
+ { "int", slang_spec_int },
+ { "ivec2", slang_spec_ivec2 },
+ { "ivec3", slang_spec_ivec3 },
+ { "ivec4", slang_spec_ivec4 },
+ { "float", slang_spec_float },
+ { "vec2", slang_spec_vec2 },
+ { "vec3", slang_spec_vec3 },
+ { "vec4", slang_spec_vec4 },
+ { "mat2", slang_spec_mat2 },
+ { "mat3", slang_spec_mat3 },
+ { "mat4", slang_spec_mat4 },
+ { "sampler1D", slang_spec_sampler1D },
+ { "sampler2D", slang_spec_sampler2D },
+ { "sampler3D", slang_spec_sampler3D },
+ { "samplerCube", slang_spec_samplerCube },
+ { "sampler1DShadow", slang_spec_sampler1DShadow },
+ { "sampler2DShadow", slang_spec_sampler2DShadow },
+ { NULL, slang_spec_void }
+};
+
+slang_type_specifier_type slang_type_specifier_type_from_string (const char *name)
+{
+ type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL)
+ {
+ if (slang_string_compare (p->name, name) == 0)
+ break;
+ p++;
+ }
+ return p->type;
+}
+
+const char *slang_type_specifier_type_to_string (slang_type_specifier_type type)
+{
+ type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL)
+ {
+ if (p->type == type)
+ break;
+ p++;
+ }
+ return p->name;
+}
+
+/* slang_fully_specified_type */
+
+int slang_fully_specified_type_construct (slang_fully_specified_type *type)
+{
+ type->qualifier = slang_qual_none;
+ slang_type_specifier_ctr (&type->specifier);
+ return 1;
+}
+
+void slang_fully_specified_type_destruct (slang_fully_specified_type *type)
+{
+ slang_type_specifier_dtr (&type->specifier);
+}
+
+int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_fully_specified_type *y)
+{
+ slang_fully_specified_type z;
+
+ if (!slang_fully_specified_type_construct (&z))
+ return 0;
+ z.qualifier = y->qualifier;
+ if (!slang_type_specifier_copy (&z.specifier, &y->specifier))
+ {
+ slang_fully_specified_type_destruct (&z);
+ return 0;
+ }
+ slang_fully_specified_type_destruct (x);
+ *x = z;
+ return 1;
+}
+
+/* slang_variable_scope */
+
+int slang_variable_scope_construct (slang_variable_scope *scope)
+{
+ scope->variables = NULL;
+ scope->num_variables = 0;
+ scope->outer_scope = NULL;
+ return 1;
+}
+
+void slang_variable_scope_destruct (slang_variable_scope *scope)
+{
+ unsigned int i;
+
+ for (i = 0; i < scope->num_variables; i++)
+ slang_variable_destruct (scope->variables + i);
+ slang_alloc_free (scope->variables);
+ /* do not free scope->outer_scope */
+}
+
+int slang_variable_scope_copy (slang_variable_scope *x, const slang_variable_scope *y)
+{
+ slang_variable_scope z;
+ unsigned int i;
+
+ if (!slang_variable_scope_construct (&z))
+ return 0;
+ z.variables = (slang_variable *) slang_alloc_malloc (y->num_variables * sizeof (slang_variable));
+ if (z.variables == NULL)
+ {
+ slang_variable_scope_destruct (&z);
+ return 0;
+ }
+ for (z.num_variables = 0; z.num_variables < y->num_variables; z.num_variables++)
+ if (!slang_variable_construct (&z.variables[z.num_variables]))
+ {
+ slang_variable_scope_destruct (&z);
+ return 0;
+ }
+ for (i = 0; i < z.num_variables; i++)
+ if (!slang_variable_copy (&z.variables[i], &y->variables[i]))
+ {
+ slang_variable_scope_destruct (&z);
+ return 0;
+ }
+ z.outer_scope = y->outer_scope;
+ slang_variable_scope_destruct (x);
+ *x = z;
+ return 1;
+}
+
+/* slang_variable */
+
+int slang_variable_construct (slang_variable *var)
+{
+ if (!slang_fully_specified_type_construct (&var->type))
+ return 0;
+ var->a_name = SLANG_ATOM_NULL;
+ var->array_len = 0;
+ var->initializer = NULL;
+ var->address = ~0;
+ var->size = 0;
+ var->global = 0;
+ return 1;
+}
+
+void slang_variable_destruct (slang_variable *var)
+{
+ slang_fully_specified_type_destruct (&var->type);
+ if (var->initializer != NULL)
+ {
+ slang_operation_destruct (var->initializer);
+ slang_alloc_free (var->initializer);
+ }
+}
+
+int slang_variable_copy (slang_variable *x, const slang_variable *y)
+{
+ slang_variable z;
+
+ if (!slang_variable_construct (&z))
+ return 0;
+ if (!slang_fully_specified_type_copy (&z.type, &y->type))
+ {
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ z.a_name = y->a_name;
+ z.array_len = y->array_len;
+ if (y->initializer != NULL)
+ {
+ z.initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
+ if (z.initializer == NULL)
+ {
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ if (!slang_operation_construct (z.initializer))
+ {
+ slang_alloc_free (z.initializer);
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ if (!slang_operation_copy (z.initializer, y->initializer))
+ {
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ }
+ z.address = y->address;
+ z.size = y->size;
+ z.global = y->global;
+ slang_variable_destruct (x);
+ *x = z;
+ return 1;
+}
+
+slang_variable *_slang_locate_variable (slang_variable_scope *scope, slang_atom a_name, GLboolean all)
+{
+ GLuint i;
+
+ for (i = 0; i < scope->num_variables; i++)
+ if (a_name == scope->variables[i].a_name)
+ return &scope->variables[i];
+ if (all && scope->outer_scope != NULL)
+ return _slang_locate_variable (scope->outer_scope, a_name, 1);
+ return NULL;
+}
+
+/*
+ * _slang_build_export_data_table()
+ */
+
+static GLenum gl_type_from_specifier (const slang_type_specifier *type)
+{
+ switch (type->type)
+ {
+ case slang_spec_bool:
+ return GL_BOOL_ARB;
+ case slang_spec_bvec2:
+ return GL_BOOL_VEC2_ARB;
+ case slang_spec_bvec3:
+ return GL_BOOL_VEC3_ARB;
+ case slang_spec_bvec4:
+ return GL_BOOL_VEC4_ARB;
+ case slang_spec_int:
+ return GL_INT;
+ case slang_spec_ivec2:
+ return GL_INT_VEC2_ARB;
+ case slang_spec_ivec3:
+ return GL_INT_VEC3_ARB;
+ case slang_spec_ivec4:
+ return GL_INT_VEC4_ARB;
+ case slang_spec_float:
+ return GL_FLOAT;
+ case slang_spec_vec2:
+ return GL_FLOAT_VEC2_ARB;
+ case slang_spec_vec3:
+ return GL_FLOAT_VEC3_ARB;
+ case slang_spec_vec4:
+ return GL_FLOAT_VEC4_ARB;
+ case slang_spec_mat2:
+ return GL_FLOAT_MAT2_ARB;
+ case slang_spec_mat3:
+ return GL_FLOAT_MAT3_ARB;
+ case slang_spec_mat4:
+ return GL_FLOAT_MAT4_ARB;
+ case slang_spec_sampler1D:
+ return GL_SAMPLER_1D_ARB;
+ case slang_spec_sampler2D:
+ return GL_SAMPLER_2D_ARB;
+ case slang_spec_sampler3D:
+ return GL_SAMPLER_3D_ARB;
+ case slang_spec_samplerCube:
+ return GL_SAMPLER_CUBE_ARB;
+ case slang_spec_sampler1DShadow:
+ return GL_SAMPLER_1D_SHADOW_ARB;
+ case slang_spec_sampler2DShadow:
+ return GL_SAMPLER_2D_SHADOW_ARB;
+ case slang_spec_array:
+ return gl_type_from_specifier (type->_array);
+ default:
+ return GL_FLOAT;
+ }
+}
+
+static GLboolean build_quant (slang_export_data_quant *q, slang_variable *var)
+{
+ slang_type_specifier *spec = &var->type.specifier;
+
+ q->name = var->a_name;
+ q->size = var->size;
+ if (spec->type == slang_spec_array)
+ {
+ q->array_len = var->array_len;
+ q->size /= var->array_len;
+ spec = spec->_array;
+ }
+ if (spec->type == slang_spec_struct)
+ {
+ GLuint i;
+
+ q->u.field_count = spec->_struct->fields->num_variables;
+ q->structure = (slang_export_data_quant *) slang_alloc_malloc (
+ q->u.field_count * sizeof (slang_export_data_quant));
+ if (q->structure == NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < q->u.field_count; i++)
+ slang_export_data_quant_ctr (&q->structure[i]);
+ for (i = 0; i < q->u.field_count; i++)
+ if (!build_quant (&q->structure[i], &spec->_struct->fields->variables[i]))
+ return GL_FALSE;
+ }
+ else
+ q->u.basic_type = gl_type_from_specifier (spec);
+ return GL_TRUE;
+}
+
+GLboolean _slang_build_export_data_table (slang_export_data_table *tbl, slang_variable_scope *vars)
+{
+ GLuint i;
+
+ for (i = 0; i < vars->num_variables; i++)
+ {
+ slang_variable *var = &vars->variables[i];
+ slang_export_data_entry *e;
+
+ e = slang_export_data_table_add (tbl);
+ if (e == NULL)
+ return GL_FALSE;
+ if (!build_quant (&e->quant, var))
+ return GL_FALSE;
+ if (var->type.qualifier == slang_qual_uniform)
+ e->access = slang_exp_uniform;
+ else if (var->type.qualifier == slang_qual_attribute)
+ e->access = slang_exp_attribute;
+ else
+ e->access = slang_exp_varying;
+ e->address = var->address;
+ }
+
+ if (vars->outer_scope != NULL)
+ return _slang_build_export_data_table (tbl, vars->outer_scope);
+ return GL_TRUE;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_COMPILE_VARIABLE_H\r
-#define SLANG_COMPILE_VARIABLE_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef enum slang_type_qualifier_\r
-{\r
- slang_qual_none,\r
- slang_qual_const,\r
- slang_qual_attribute,\r
- slang_qual_varying,\r
- slang_qual_uniform,\r
- slang_qual_out,\r
- slang_qual_inout,\r
- slang_qual_fixedoutput, /* internal */\r
- slang_qual_fixedinput /* internal */\r
-} slang_type_qualifier;\r
-\r
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *);\r
-const char *slang_type_specifier_type_to_string (slang_type_specifier_type);\r
-\r
-typedef struct slang_fully_specified_type_\r
-{\r
- slang_type_qualifier qualifier;\r
- slang_type_specifier specifier;\r
-} slang_fully_specified_type;\r
-\r
-int slang_fully_specified_type_construct (slang_fully_specified_type *);\r
-void slang_fully_specified_type_destruct (slang_fully_specified_type *);\r
-int slang_fully_specified_type_copy (slang_fully_specified_type *, const slang_fully_specified_type *);\r
-\r
-typedef struct slang_variable_scope_\r
-{\r
- struct slang_variable_ *variables;\r
- unsigned int num_variables;\r
- struct slang_variable_scope_ *outer_scope;\r
-} slang_variable_scope;\r
-\r
-int slang_variable_scope_construct (slang_variable_scope *);\r
-void slang_variable_scope_destruct (slang_variable_scope *);\r
-int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *);\r
-\r
-typedef struct slang_variable_\r
-{\r
- slang_fully_specified_type type;\r
- slang_atom a_name;\r
- GLuint array_len; /* type: spec_array */\r
- struct slang_operation_ *initializer;\r
- unsigned int address;\r
- unsigned int size;\r
- int global;\r
-} slang_variable;\r
-\r
-int slang_variable_construct (slang_variable *);\r
-void slang_variable_destruct (slang_variable *);\r
-int slang_variable_copy (slang_variable *, const slang_variable *);\r
-\r
-slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all);\r
-\r
-GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_COMPILE_VARIABLE_H
+#define SLANG_COMPILE_VARIABLE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef enum slang_type_qualifier_
+{
+ slang_qual_none,
+ slang_qual_const,
+ slang_qual_attribute,
+ slang_qual_varying,
+ slang_qual_uniform,
+ slang_qual_out,
+ slang_qual_inout,
+ slang_qual_fixedoutput, /* internal */
+ slang_qual_fixedinput /* internal */
+} slang_type_qualifier;
+
+slang_type_specifier_type slang_type_specifier_type_from_string (const char *);
+const char *slang_type_specifier_type_to_string (slang_type_specifier_type);
+
+typedef struct slang_fully_specified_type_
+{
+ slang_type_qualifier qualifier;
+ slang_type_specifier specifier;
+} slang_fully_specified_type;
+
+int slang_fully_specified_type_construct (slang_fully_specified_type *);
+void slang_fully_specified_type_destruct (slang_fully_specified_type *);
+int slang_fully_specified_type_copy (slang_fully_specified_type *, const slang_fully_specified_type *);
+
+typedef struct slang_variable_scope_
+{
+ struct slang_variable_ *variables;
+ unsigned int num_variables;
+ struct slang_variable_scope_ *outer_scope;
+} slang_variable_scope;
+
+int slang_variable_scope_construct (slang_variable_scope *);
+void slang_variable_scope_destruct (slang_variable_scope *);
+int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *);
+
+typedef struct slang_variable_
+{
+ slang_fully_specified_type type;
+ slang_atom a_name;
+ GLuint array_len; /* type: spec_array */
+ struct slang_operation_ *initializer;
+ unsigned int address;
+ unsigned int size;
+ int global;
+} slang_variable;
+
+int slang_variable_construct (slang_variable *);
+void slang_variable_destruct (slang_variable *);
+int slang_variable_copy (slang_variable *, const slang_variable *);
+
+slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all);
+
+GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_execute.c\r
- * intermediate code interpreter\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_execute.h"\r
-#include "slang_library_noise.h"\r
-#include "slang_library_texsample.h"\r
-\r
-#define DEBUG_SLANG 0\r
-\r
-GLvoid slang_machine_ctr (slang_machine *self)\r
-{\r
- slang_machine_init (self);\r
-#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
- self->x86.compiled_func = NULL;\r
-#endif\r
-}\r
-\r
-GLvoid slang_machine_dtr (slang_machine *self)\r
-{\r
-#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
- if (self->x86.compiled_func != NULL)\r
- _mesa_exec_free (self->x86.compiled_func);\r
-#endif\r
-}\r
-\r
-void slang_machine_init (slang_machine *mach)\r
-{\r
- mach->ip = 0;\r
- mach->sp = SLANG_MACHINE_STACK_SIZE;\r
- mach->bp = 0;\r
- mach->kill = 0;\r
- mach->exit = 0;\r
-}\r
-\r
-int _slang_execute (const slang_assembly_file *file)\r
-{\r
- slang_machine mach;\r
-\r
- slang_machine_ctr (&mach);\r
- return _slang_execute2 (file, &mach);\r
-}\r
-\r
-#if DEBUG_SLANG\r
-\r
-static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)\r
-{\r
- fprintf (f, "%.5u:\t", i);\r
- \r
- switch (a->type)\r
- {\r
- /* core */\r
- case slang_asm_none:\r
- fprintf (f, "none");\r
- break;\r
- case slang_asm_float_copy:\r
- fprintf (f, "float_copy\t%d, %d", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_float_move:\r
- fprintf (f, "float_move\t%d, %d", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_float_push:\r
- fprintf (f, "float_push\t%f", a->literal);\r
- break;\r
- case slang_asm_float_deref:\r
- fprintf (f, "float_deref");\r
- break;\r
- case slang_asm_float_add:\r
- fprintf (f, "float_add");\r
- break;\r
- case slang_asm_float_multiply:\r
- fprintf (f, "float_multiply");\r
- break;\r
- case slang_asm_float_divide:\r
- fprintf (f, "float_divide");\r
- break;\r
- case slang_asm_float_negate:\r
- fprintf (f, "float_negate");\r
- break;\r
- case slang_asm_float_less:\r
- fprintf (f, "float_less");\r
- break;\r
- case slang_asm_float_equal_exp:\r
- fprintf (f, "float_equal");\r
- break;\r
- case slang_asm_float_equal_int:\r
- fprintf (f, "float_equal\t%d, %d", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_float_to_int:\r
- fprintf (f, "float_to_int");\r
- break;\r
- case slang_asm_float_sine:\r
- fprintf (f, "float_sine");\r
- break;\r
- case slang_asm_float_arcsine:\r
- fprintf (f, "float_arcsine");\r
- break;\r
- case slang_asm_float_arctan:\r
- fprintf (f, "float_arctan");\r
- break;\r
- case slang_asm_float_power:\r
- fprintf (f, "float_power");\r
- break;\r
- case slang_asm_float_log2:\r
- fprintf (f, "float_log2");\r
- break;\r
- case slang_asm_float_floor:\r
- fprintf (f, "float_floor");\r
- break;\r
- case slang_asm_float_ceil:\r
- fprintf (f, "float_ceil");\r
- break;\r
- case slang_asm_float_noise1:\r
- fprintf (f, "float_noise1");\r
- break;\r
- case slang_asm_float_noise2:\r
- fprintf (f, "float_noise2");\r
- break;\r
- case slang_asm_float_noise3:\r
- fprintf (f, "float_noise3");\r
- break;\r
- case slang_asm_float_noise4:\r
- fprintf (f, "float_noise4");\r
- break;\r
- case slang_asm_int_copy:\r
- fprintf (f, "int_copy\t%d, %d", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_int_move:\r
- fprintf (f, "int_move\t%d, %d", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_int_push:\r
- fprintf (f, "int_push\t%d", (GLint) a->literal);\r
- break;\r
- case slang_asm_int_deref:\r
- fprintf (f, "int_deref");\r
- break;\r
- case slang_asm_int_to_float:\r
- fprintf (f, "int_to_float");\r
- break;\r
- case slang_asm_int_to_addr:\r
- fprintf (f, "int_to_addr");\r
- break;\r
- case slang_asm_bool_copy:\r
- fprintf (f, "bool_copy\t%d, %d", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_bool_move:\r
- fprintf (f, "bool_move\t%d, %d", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_bool_push:\r
- fprintf (f, "bool_push\t%d", a->literal != 0.0f);\r
- break;\r
- case slang_asm_bool_deref:\r
- fprintf (f, "bool_deref");\r
- break;\r
- case slang_asm_addr_copy:\r
- fprintf (f, "addr_copy");\r
- break;\r
- case slang_asm_addr_push:\r
- fprintf (f, "addr_push\t%u", a->param[0]);\r
- break;\r
- case slang_asm_addr_deref:\r
- fprintf (f, "addr_deref");\r
- break;\r
- case slang_asm_addr_add:\r
- fprintf (f, "addr_add");\r
- break;\r
- case slang_asm_addr_multiply:\r
- fprintf (f, "addr_multiply");\r
- break;\r
- case slang_asm_vec4_tex1d:\r
- fprintf (f, "vec4_tex1d");\r
- break;\r
- case slang_asm_vec4_tex2d:\r
- fprintf (f, "vec4_tex2d");\r
- break;\r
- case slang_asm_vec4_tex3d:\r
- fprintf (f, "vec4_tex3d");\r
- break;\r
- case slang_asm_vec4_texcube:\r
- fprintf (f, "vec4_texcube");\r
- break;\r
- case slang_asm_vec4_shad1d:\r
- fprintf (f, "vec4_shad1d");\r
- break;\r
- case slang_asm_vec4_shad2d:\r
- fprintf (f, "vec4_shad2d");\r
- break;\r
- case slang_asm_jump:\r
- fprintf (f, "jump\t%u", a->param[0]);\r
- break;\r
- case slang_asm_jump_if_zero:\r
- fprintf (f, "jump_if_zero\t%u", a->param[0]);\r
- break;\r
- case slang_asm_enter:\r
- fprintf (f, "enter\t%u", a->param[0]);\r
- break;\r
- case slang_asm_leave:\r
- fprintf (f, "leave");\r
- break;\r
- case slang_asm_local_alloc:\r
- fprintf (f, "local_alloc\t%u", a->param[0]);\r
- break;\r
- case slang_asm_local_free:\r
- fprintf (f, "local_free\t%u", a->param[0]);\r
- break;\r
- case slang_asm_local_addr:\r
- fprintf (f, "local_addr\t%u, %u", a->param[0], a->param[1]);\r
- break;\r
- case slang_asm_global_addr:\r
- fprintf (f, "global_addr\t%u", a->param[0]);\r
- break;\r
- case slang_asm_call:\r
- fprintf (f, "call\t%u", a->param[0]);\r
- break;\r
- case slang_asm_return:\r
- fprintf (f, "return");\r
- break;\r
- case slang_asm_discard:\r
- fprintf (f, "discard");\r
- break;\r
- case slang_asm_exit:\r
- fprintf (f, "exit");\r
- break;\r
- /* mesa-specific extensions */\r
- case slang_asm_float_print:\r
- fprintf (f, "float_print");\r
- break;\r
- case slang_asm_int_print:\r
- fprintf (f, "int_print");\r
- break;\r
- case slang_asm_bool_print:\r
- fprintf (f, "bool_print");\r
- break;\r
- default:\r
- break;\r
- }\r
-\r
- fprintf (f, "\n");\r
-}\r
-\r
-static void dump (const slang_assembly_file *file)\r
-{\r
- unsigned int i;\r
- static unsigned int counter = 0;\r
- FILE *f;\r
- char filename[256];\r
-\r
- counter++;\r
- _mesa_sprintf (filename, "~mesa-slang-assembly-dump-(%u).txt", counter);\r
- f = fopen (filename, "w");\r
- if (f == NULL)\r
- return;\r
-\r
- for (i = 0; i < file->count; i++)\r
- dump_instruction (f, file->code + i, i);\r
-\r
- fclose (f);\r
-}\r
-\r
-#endif\r
-\r
-int _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)\r
-{\r
- slang_machine_slot *stack;\r
-\r
-#if DEBUG_SLANG\r
- static unsigned int counter = 0;\r
- char filename[256];\r
- FILE *f;\r
-#endif\r
-\r
- /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */\r
- static_assert(sizeof (GLfloat) == 4);\r
- static_assert(sizeof (GLuint) == 4);\r
-\r
-#if DEBUG_SLANG\r
- dump (file);\r
- counter++;\r
- _mesa_sprintf (filename, "~mesa-slang-assembly-exec-(%u).txt", counter);\r
- f = fopen (filename, "w");\r
-#endif\r
-\r
-#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
- if (mach->x86.compiled_func != NULL)\r
- {\r
- mach->x86.compiled_func (mach);\r
- return 1;\r
- }\r
-#endif\r
-\r
- stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE;\r
-\r
- while (!mach->exit)\r
- {\r
- slang_assembly *a = &file->code[mach->ip];\r
-\r
-#if DEBUG_SLANG\r
- if (f != NULL && a->type != slang_asm_none)\r
- {\r
- unsigned int i;\r
-\r
- dump_instruction (f, file->code + mach->ip, mach->ip);\r
- fprintf (f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp);\r
- for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++)\r
- fprintf (f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float, stack[i]._addr);\r
- fflush (f);\r
- }\r
-#endif\r
-\r
- mach->ip++;\r
-\r
- switch (a->type)\r
- {\r
- /* core */\r
- case slang_asm_none:\r
- break;\r
- case slang_asm_float_copy:\r
- case slang_asm_int_copy:\r
- case slang_asm_bool_copy:\r
- mach->mem[(stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4]._float =\r
- stack[mach->sp]._float;\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_move:\r
- case slang_asm_int_move:\r
- case slang_asm_bool_move:\r
- stack[mach->sp + a->param[0] / 4]._float =\r
- stack[mach->sp + (stack[mach->sp]._addr + a->param[1]) / 4]._float;\r
- break;\r
- case slang_asm_float_push:\r
- case slang_asm_int_push:\r
- case slang_asm_bool_push:\r
- mach->sp--;\r
- stack[mach->sp]._float = a->literal;\r
- break;\r
- case slang_asm_float_deref:\r
- case slang_asm_int_deref:\r
- case slang_asm_bool_deref:\r
- stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float;\r
- break;\r
- case slang_asm_float_add:\r
- stack[mach->sp + 1]._float += stack[mach->sp]._float;\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_multiply:\r
- stack[mach->sp + 1]._float *= stack[mach->sp]._float;\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_divide:\r
- stack[mach->sp + 1]._float /= stack[mach->sp]._float;\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_negate:\r
- stack[mach->sp]._float = -stack[mach->sp]._float;\r
- break;\r
- case slang_asm_float_less:\r
- stack[mach->sp + 1]._float =\r
- stack[mach->sp + 1]._float < stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_equal_exp:\r
- stack[mach->sp + 1]._float =\r
- stack[mach->sp + 1]._float == stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_equal_int:\r
- mach->sp--;\r
- stack[mach->sp]._float = stack[mach->sp + 1 + a->param[0] / 4]._float ==\r
- stack[mach->sp + 1 + a->param[1] / 4]._float ? (GLfloat) 1 : (GLfloat) 0;\r
- break;\r
- case slang_asm_float_to_int:\r
- stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float;\r
- break;\r
- case slang_asm_float_sine:\r
- stack[mach->sp]._float = (GLfloat) _mesa_sin (stack[mach->sp]._float);\r
- break;\r
- case slang_asm_float_arcsine:\r
- stack[mach->sp]._float = _mesa_asinf (stack[mach->sp]._float);\r
- break;\r
- case slang_asm_float_arctan:\r
- stack[mach->sp]._float = _mesa_atanf (stack[mach->sp]._float);\r
- break;\r
- case slang_asm_float_power:\r
- stack[mach->sp + 1]._float =\r
- (GLfloat) _mesa_pow (stack[mach->sp + 1]._float, stack[mach->sp]._float);\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_log2:\r
- stack[mach->sp]._float = LOG2 (stack[mach->sp]._float);\r
- break;\r
- case slang_asm_float_floor:\r
- stack[mach->sp]._float = FLOORF (stack[mach->sp]._float);\r
- break;\r
- case slang_asm_float_ceil:\r
- stack[mach->sp]._float = CEILF (stack[mach->sp]._float);\r
- break;\r
- case slang_asm_float_noise1:\r
- stack[mach->sp]._float = _slang_library_noise1 (stack[mach->sp]._float);\r
- break;\r
- case slang_asm_float_noise2:\r
- stack[mach->sp + 1]._float = _slang_library_noise2 (stack[mach->sp]._float,\r
- stack[mach->sp + 1]._float);\r
- mach->sp++;\r
- break;\r
- case slang_asm_float_noise3:\r
- stack[mach->sp + 2]._float = _slang_library_noise3 (stack[mach->sp]._float,\r
- stack[mach->sp + 1]._float, stack[mach->sp + 2]._float);\r
- mach->sp += 2;\r
- break;\r
- case slang_asm_float_noise4:\r
- stack[mach->sp + 3]._float = _slang_library_noise4 (stack[mach->sp]._float,\r
- stack[mach->sp + 1]._float, stack[mach->sp + 2]._float, stack[mach->sp + 3]._float);\r
- mach->sp += 3;\r
- break;\r
- case slang_asm_int_to_float:\r
- break;\r
- case slang_asm_int_to_addr:\r
- stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float;\r
- break;\r
- case slang_asm_addr_copy:\r
- mach->mem[stack[mach->sp + 1]._addr / 4]._addr = stack[mach->sp]._addr;\r
- mach->sp++;\r
- break;\r
- case slang_asm_addr_push:\r
- case slang_asm_global_addr:\r
- mach->sp--;\r
- stack[mach->sp]._addr = a->param[0];\r
- break;\r
- case slang_asm_addr_deref:\r
- stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr;\r
- break;\r
- case slang_asm_addr_add:\r
- stack[mach->sp + 1]._addr += stack[mach->sp]._addr;\r
- mach->sp++;\r
- break;\r
- case slang_asm_addr_multiply:\r
- stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;\r
- mach->sp++;\r
- break;\r
- case slang_asm_vec4_tex1d:\r
- _slang_library_tex1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
- stack[mach->sp + 2]._float, &mach->mem[stack[mach->sp + 3]._addr / 4]._float);\r
- mach->sp += 3;\r
- break;\r
- case slang_asm_vec4_tex2d:\r
- _slang_library_tex2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float,\r
- &mach->mem[stack[mach->sp + 4]._addr / 4]._float);\r
- mach->sp += 4;\r
- break;\r
- case slang_asm_vec4_tex3d:\r
- _slang_library_tex3d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
- mach->sp += 5;\r
- break;\r
- case slang_asm_vec4_texcube:\r
- _slang_library_texcube (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
- mach->sp += 5;\r
- break;\r
- case slang_asm_vec4_shad1d:\r
- _slang_library_shad1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
- mach->sp += 5;\r
- break;\r
- case slang_asm_vec4_shad2d:\r
- _slang_library_shad2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
- mach->sp += 5;\r
- break;\r
- case slang_asm_jump:\r
- mach->ip = a->param[0];\r
- break;\r
- case slang_asm_jump_if_zero:\r
- if (stack[mach->sp]._float == 0.0f)\r
- mach->ip = a->param[0];\r
- mach->sp++;\r
- break;\r
- case slang_asm_enter:\r
- mach->sp--;\r
- stack[mach->sp]._addr = mach->bp;\r
- mach->bp = mach->sp + a->param[0] / 4;\r
- break;\r
- case slang_asm_leave:\r
- mach->bp = stack[mach->sp]._addr;\r
- mach->sp++;\r
- break;\r
- case slang_asm_local_alloc:\r
- mach->sp -= a->param[0] / 4;\r
- break;\r
- case slang_asm_local_free:\r
- mach->sp += a->param[0] / 4;\r
- break;\r
- case slang_asm_local_addr:\r
- mach->sp--;\r
- stack[mach->sp]._addr = SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 - \r
- (a->param[0] + a->param[1]) + 4;\r
- break;\r
- case slang_asm_call:\r
- mach->sp--;\r
- stack[mach->sp]._addr = mach->ip;\r
- mach->ip = a->param[0];\r
- break;\r
- case slang_asm_return:\r
- mach->ip = stack[mach->sp]._addr;\r
- mach->sp++;\r
- break;\r
- case slang_asm_discard:\r
- mach->kill = 1;\r
- break;\r
- case slang_asm_exit:\r
- mach->exit = 1;\r
- break;\r
- /* mesa-specific extensions */\r
- case slang_asm_float_print:\r
- _mesa_printf ("slang print: %f\n", stack[mach->sp]._float);\r
- break;\r
- case slang_asm_int_print:\r
- _mesa_printf ("slang print: %d\n", (GLint) stack[mach->sp]._float);\r
- break;\r
- case slang_asm_bool_print:\r
- _mesa_printf ("slang print: %s\n", (GLint) stack[mach->sp]._float ? "true" : "false");\r
- break;\r
- default:\r
- assert (0);\r
- }\r
- }\r
-\r
-#if DEBUG_SLANG\r
- if (f != NULL)\r
- fclose (f);\r
-#endif\r
-\r
- return 1;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_execute.c
+ * intermediate code interpreter
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_execute.h"
+#include "slang_library_noise.h"
+#include "slang_library_texsample.h"
+
+#define DEBUG_SLANG 0
+
+GLvoid slang_machine_ctr (slang_machine *self)
+{
+ slang_machine_init (self);
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ self->x86.compiled_func = NULL;
+#endif
+}
+
+GLvoid slang_machine_dtr (slang_machine *self)
+{
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ if (self->x86.compiled_func != NULL)
+ _mesa_exec_free (self->x86.compiled_func);
+#endif
+}
+
+void slang_machine_init (slang_machine *mach)
+{
+ mach->ip = 0;
+ mach->sp = SLANG_MACHINE_STACK_SIZE;
+ mach->bp = 0;
+ mach->kill = 0;
+ mach->exit = 0;
+}
+
+int _slang_execute (const slang_assembly_file *file)
+{
+ slang_machine mach;
+
+ slang_machine_ctr (&mach);
+ return _slang_execute2 (file, &mach);
+}
+
+#if DEBUG_SLANG
+
+static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
+{
+ fprintf (f, "%.5u:\t", i);
+
+ switch (a->type)
+ {
+ /* core */
+ case slang_asm_none:
+ fprintf (f, "none");
+ break;
+ case slang_asm_float_copy:
+ fprintf (f, "float_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_move:
+ fprintf (f, "float_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_push:
+ fprintf (f, "float_push\t%f", a->literal);
+ break;
+ case slang_asm_float_deref:
+ fprintf (f, "float_deref");
+ break;
+ case slang_asm_float_add:
+ fprintf (f, "float_add");
+ break;
+ case slang_asm_float_multiply:
+ fprintf (f, "float_multiply");
+ break;
+ case slang_asm_float_divide:
+ fprintf (f, "float_divide");
+ break;
+ case slang_asm_float_negate:
+ fprintf (f, "float_negate");
+ break;
+ case slang_asm_float_less:
+ fprintf (f, "float_less");
+ break;
+ case slang_asm_float_equal_exp:
+ fprintf (f, "float_equal");
+ break;
+ case slang_asm_float_equal_int:
+ fprintf (f, "float_equal\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_to_int:
+ fprintf (f, "float_to_int");
+ break;
+ case slang_asm_float_sine:
+ fprintf (f, "float_sine");
+ break;
+ case slang_asm_float_arcsine:
+ fprintf (f, "float_arcsine");
+ break;
+ case slang_asm_float_arctan:
+ fprintf (f, "float_arctan");
+ break;
+ case slang_asm_float_power:
+ fprintf (f, "float_power");
+ break;
+ case slang_asm_float_log2:
+ fprintf (f, "float_log2");
+ break;
+ case slang_asm_float_floor:
+ fprintf (f, "float_floor");
+ break;
+ case slang_asm_float_ceil:
+ fprintf (f, "float_ceil");
+ break;
+ case slang_asm_float_noise1:
+ fprintf (f, "float_noise1");
+ break;
+ case slang_asm_float_noise2:
+ fprintf (f, "float_noise2");
+ break;
+ case slang_asm_float_noise3:
+ fprintf (f, "float_noise3");
+ break;
+ case slang_asm_float_noise4:
+ fprintf (f, "float_noise4");
+ break;
+ case slang_asm_int_copy:
+ fprintf (f, "int_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_int_move:
+ fprintf (f, "int_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_int_push:
+ fprintf (f, "int_push\t%d", (GLint) a->literal);
+ break;
+ case slang_asm_int_deref:
+ fprintf (f, "int_deref");
+ break;
+ case slang_asm_int_to_float:
+ fprintf (f, "int_to_float");
+ break;
+ case slang_asm_int_to_addr:
+ fprintf (f, "int_to_addr");
+ break;
+ case slang_asm_bool_copy:
+ fprintf (f, "bool_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_bool_move:
+ fprintf (f, "bool_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_bool_push:
+ fprintf (f, "bool_push\t%d", a->literal != 0.0f);
+ break;
+ case slang_asm_bool_deref:
+ fprintf (f, "bool_deref");
+ break;
+ case slang_asm_addr_copy:
+ fprintf (f, "addr_copy");
+ break;
+ case slang_asm_addr_push:
+ fprintf (f, "addr_push\t%u", a->param[0]);
+ break;
+ case slang_asm_addr_deref:
+ fprintf (f, "addr_deref");
+ break;
+ case slang_asm_addr_add:
+ fprintf (f, "addr_add");
+ break;
+ case slang_asm_addr_multiply:
+ fprintf (f, "addr_multiply");
+ break;
+ case slang_asm_vec4_tex1d:
+ fprintf (f, "vec4_tex1d");
+ break;
+ case slang_asm_vec4_tex2d:
+ fprintf (f, "vec4_tex2d");
+ break;
+ case slang_asm_vec4_tex3d:
+ fprintf (f, "vec4_tex3d");
+ break;
+ case slang_asm_vec4_texcube:
+ fprintf (f, "vec4_texcube");
+ break;
+ case slang_asm_vec4_shad1d:
+ fprintf (f, "vec4_shad1d");
+ break;
+ case slang_asm_vec4_shad2d:
+ fprintf (f, "vec4_shad2d");
+ break;
+ case slang_asm_jump:
+ fprintf (f, "jump\t%u", a->param[0]);
+ break;
+ case slang_asm_jump_if_zero:
+ fprintf (f, "jump_if_zero\t%u", a->param[0]);
+ break;
+ case slang_asm_enter:
+ fprintf (f, "enter\t%u", a->param[0]);
+ break;
+ case slang_asm_leave:
+ fprintf (f, "leave");
+ break;
+ case slang_asm_local_alloc:
+ fprintf (f, "local_alloc\t%u", a->param[0]);
+ break;
+ case slang_asm_local_free:
+ fprintf (f, "local_free\t%u", a->param[0]);
+ break;
+ case slang_asm_local_addr:
+ fprintf (f, "local_addr\t%u, %u", a->param[0], a->param[1]);
+ break;
+ case slang_asm_global_addr:
+ fprintf (f, "global_addr\t%u", a->param[0]);
+ break;
+ case slang_asm_call:
+ fprintf (f, "call\t%u", a->param[0]);
+ break;
+ case slang_asm_return:
+ fprintf (f, "return");
+ break;
+ case slang_asm_discard:
+ fprintf (f, "discard");
+ break;
+ case slang_asm_exit:
+ fprintf (f, "exit");
+ break;
+ /* mesa-specific extensions */
+ case slang_asm_float_print:
+ fprintf (f, "float_print");
+ break;
+ case slang_asm_int_print:
+ fprintf (f, "int_print");
+ break;
+ case slang_asm_bool_print:
+ fprintf (f, "bool_print");
+ break;
+ default:
+ break;
+ }
+
+ fprintf (f, "\n");
+}
+
+static void dump (const slang_assembly_file *file)
+{
+ unsigned int i;
+ static unsigned int counter = 0;
+ FILE *f;
+ char filename[256];
+
+ counter++;
+ _mesa_sprintf (filename, "~mesa-slang-assembly-dump-(%u).txt", counter);
+ f = fopen (filename, "w");
+ if (f == NULL)
+ return;
+
+ for (i = 0; i < file->count; i++)
+ dump_instruction (f, file->code + i, i);
+
+ fclose (f);
+}
+
+#endif
+
+int _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
+{
+ slang_machine_slot *stack;
+
+#if DEBUG_SLANG
+ static unsigned int counter = 0;
+ char filename[256];
+ FILE *f;
+#endif
+
+ /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */
+ static_assert(sizeof (GLfloat) == 4);
+ static_assert(sizeof (GLuint) == 4);
+
+#if DEBUG_SLANG
+ dump (file);
+ counter++;
+ _mesa_sprintf (filename, "~mesa-slang-assembly-exec-(%u).txt", counter);
+ f = fopen (filename, "w");
+#endif
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ if (mach->x86.compiled_func != NULL)
+ {
+ mach->x86.compiled_func (mach);
+ return 1;
+ }
+#endif
+
+ stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE;
+
+ while (!mach->exit)
+ {
+ slang_assembly *a = &file->code[mach->ip];
+
+#if DEBUG_SLANG
+ if (f != NULL && a->type != slang_asm_none)
+ {
+ unsigned int i;
+
+ dump_instruction (f, file->code + mach->ip, mach->ip);
+ fprintf (f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp);
+ for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++)
+ fprintf (f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float, stack[i]._addr);
+ fflush (f);
+ }
+#endif
+
+ mach->ip++;
+
+ switch (a->type)
+ {
+ /* core */
+ case slang_asm_none:
+ break;
+ case slang_asm_float_copy:
+ case slang_asm_int_copy:
+ case slang_asm_bool_copy:
+ mach->mem[(stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4]._float =
+ stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_move:
+ case slang_asm_int_move:
+ case slang_asm_bool_move:
+ stack[mach->sp + a->param[0] / 4]._float =
+ stack[mach->sp + (stack[mach->sp]._addr + a->param[1]) / 4]._float;
+ break;
+ case slang_asm_float_push:
+ case slang_asm_int_push:
+ case slang_asm_bool_push:
+ mach->sp--;
+ stack[mach->sp]._float = a->literal;
+ break;
+ case slang_asm_float_deref:
+ case slang_asm_int_deref:
+ case slang_asm_bool_deref:
+ stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float;
+ break;
+ case slang_asm_float_add:
+ stack[mach->sp + 1]._float += stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_multiply:
+ stack[mach->sp + 1]._float *= stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_divide:
+ stack[mach->sp + 1]._float /= stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_negate:
+ stack[mach->sp]._float = -stack[mach->sp]._float;
+ break;
+ case slang_asm_float_less:
+ stack[mach->sp + 1]._float =
+ stack[mach->sp + 1]._float < stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
+ break;
+ case slang_asm_float_equal_exp:
+ stack[mach->sp + 1]._float =
+ stack[mach->sp + 1]._float == stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
+ break;
+ case slang_asm_float_equal_int:
+ mach->sp--;
+ stack[mach->sp]._float = stack[mach->sp + 1 + a->param[0] / 4]._float ==
+ stack[mach->sp + 1 + a->param[1] / 4]._float ? (GLfloat) 1 : (GLfloat) 0;
+ break;
+ case slang_asm_float_to_int:
+ stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float;
+ break;
+ case slang_asm_float_sine:
+ stack[mach->sp]._float = (GLfloat) _mesa_sin (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arcsine:
+ stack[mach->sp]._float = _mesa_asinf (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arctan:
+ stack[mach->sp]._float = _mesa_atanf (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_power:
+ stack[mach->sp + 1]._float =
+ (GLfloat) _mesa_pow (stack[mach->sp + 1]._float, stack[mach->sp]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_log2:
+ stack[mach->sp]._float = LOG2 (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_floor:
+ stack[mach->sp]._float = FLOORF (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_ceil:
+ stack[mach->sp]._float = CEILF (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise1:
+ stack[mach->sp]._float = _slang_library_noise1 (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise2:
+ stack[mach->sp + 1]._float = _slang_library_noise2 (stack[mach->sp]._float,
+ stack[mach->sp + 1]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_noise3:
+ stack[mach->sp + 2]._float = _slang_library_noise3 (stack[mach->sp]._float,
+ stack[mach->sp + 1]._float, stack[mach->sp + 2]._float);
+ mach->sp += 2;
+ break;
+ case slang_asm_float_noise4:
+ stack[mach->sp + 3]._float = _slang_library_noise4 (stack[mach->sp]._float,
+ stack[mach->sp + 1]._float, stack[mach->sp + 2]._float, stack[mach->sp + 3]._float);
+ mach->sp += 3;
+ break;
+ case slang_asm_int_to_float:
+ break;
+ case slang_asm_int_to_addr:
+ stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float;
+ break;
+ case slang_asm_addr_copy:
+ mach->mem[stack[mach->sp + 1]._addr / 4]._addr = stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_addr_push:
+ case slang_asm_global_addr:
+ mach->sp--;
+ stack[mach->sp]._addr = a->param[0];
+ break;
+ case slang_asm_addr_deref:
+ stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr;
+ break;
+ case slang_asm_addr_add:
+ stack[mach->sp + 1]._addr += stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_addr_multiply:
+ stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_vec4_tex1d:
+ _slang_library_tex1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, &mach->mem[stack[mach->sp + 3]._addr / 4]._float);
+ mach->sp += 3;
+ break;
+ case slang_asm_vec4_tex2d:
+ _slang_library_tex2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float,
+ &mach->mem[stack[mach->sp + 4]._addr / 4]._float);
+ mach->sp += 4;
+ break;
+ case slang_asm_vec4_tex3d:
+ _slang_library_tex3d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_texcube:
+ _slang_library_texcube (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad1d:
+ _slang_library_shad1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad2d:
+ _slang_library_shad2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_jump:
+ mach->ip = a->param[0];
+ break;
+ case slang_asm_jump_if_zero:
+ if (stack[mach->sp]._float == 0.0f)
+ mach->ip = a->param[0];
+ mach->sp++;
+ break;
+ case slang_asm_enter:
+ mach->sp--;
+ stack[mach->sp]._addr = mach->bp;
+ mach->bp = mach->sp + a->param[0] / 4;
+ break;
+ case slang_asm_leave:
+ mach->bp = stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_local_alloc:
+ mach->sp -= a->param[0] / 4;
+ break;
+ case slang_asm_local_free:
+ mach->sp += a->param[0] / 4;
+ break;
+ case slang_asm_local_addr:
+ mach->sp--;
+ stack[mach->sp]._addr = SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 -
+ (a->param[0] + a->param[1]) + 4;
+ break;
+ case slang_asm_call:
+ mach->sp--;
+ stack[mach->sp]._addr = mach->ip;
+ mach->ip = a->param[0];
+ break;
+ case slang_asm_return:
+ mach->ip = stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_discard:
+ mach->kill = 1;
+ break;
+ case slang_asm_exit:
+ mach->exit = 1;
+ break;
+ /* mesa-specific extensions */
+ case slang_asm_float_print:
+ _mesa_printf ("slang print: %f\n", stack[mach->sp]._float);
+ break;
+ case slang_asm_int_print:
+ _mesa_printf ("slang print: %d\n", (GLint) stack[mach->sp]._float);
+ break;
+ case slang_asm_bool_print:
+ _mesa_printf ("slang print: %s\n", (GLint) stack[mach->sp]._float ? "true" : "false");
+ break;
+ default:
+ assert (0);
+ }
+ }
+
+#if DEBUG_SLANG
+ if (f != NULL)
+ fclose (f);
+#endif
+
+ return 1;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_EXECUTE_H\r
-#define SLANG_EXECUTE_H\r
-\r
-#include "slang_assemble.h"\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef union slang_machine_slot_\r
-{\r
- GLfloat _float;\r
- GLuint _addr;\r
-} slang_machine_slot;\r
-\r
-#define SLANG_MACHINE_GLOBAL_SIZE 3072\r
-#define SLANG_MACHINE_STACK_SIZE 1024\r
-#define SLANG_MACHINE_MEMORY_SIZE (SLANG_MACHINE_GLOBAL_SIZE + SLANG_MACHINE_STACK_SIZE)\r
-\r
-#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
-typedef struct\r
-{\r
- GLvoid (* compiled_func) (struct slang_machine_ *);\r
- GLuint esp_restore;\r
- GLshort fpucntl_rnd_neg;\r
- GLshort fpucntl_restore;\r
-} slang_machine_x86;\r
-#endif\r
-\r
-typedef struct slang_machine_\r
-{\r
- GLuint ip; /* instruction pointer, for flow control */\r
- GLuint sp; /* stack pointer, for stack access */\r
- GLuint bp; /* base pointer, for local variable access */\r
- GLuint kill; /* discard the fragment */\r
- GLuint exit; /* terminate the shader */\r
- slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];\r
-#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
- slang_machine_x86 x86;\r
-#endif\r
-} slang_machine;\r
-\r
-GLvoid slang_machine_ctr (slang_machine *);\r
-GLvoid slang_machine_dtr (slang_machine *);\r
-\r
-void slang_machine_init (slang_machine *);\r
-\r
-int _slang_execute (const slang_assembly_file *);\r
-int _slang_execute2 (const slang_assembly_file *, slang_machine *);\r
-\r
-#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
-GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint);\r
-#endif\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_EXECUTE_H
+#define SLANG_EXECUTE_H
+
+#include "slang_assemble.h"
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef union slang_machine_slot_
+{
+ GLfloat _float;
+ GLuint _addr;
+} slang_machine_slot;
+
+#define SLANG_MACHINE_GLOBAL_SIZE 3072
+#define SLANG_MACHINE_STACK_SIZE 1024
+#define SLANG_MACHINE_MEMORY_SIZE (SLANG_MACHINE_GLOBAL_SIZE + SLANG_MACHINE_STACK_SIZE)
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+typedef struct
+{
+ GLvoid (* compiled_func) (struct slang_machine_ *);
+ GLuint esp_restore;
+ GLshort fpucntl_rnd_neg;
+ GLshort fpucntl_restore;
+} slang_machine_x86;
+#endif
+
+typedef struct slang_machine_
+{
+ GLuint ip; /* instruction pointer, for flow control */
+ GLuint sp; /* stack pointer, for stack access */
+ GLuint bp; /* base pointer, for local variable access */
+ GLuint kill; /* discard the fragment */
+ GLuint exit; /* terminate the shader */
+ slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ slang_machine_x86 x86;
+#endif
+} slang_machine;
+
+GLvoid slang_machine_ctr (slang_machine *);
+GLvoid slang_machine_dtr (slang_machine *);
+
+void slang_machine_init (slang_machine *);
+
+int _slang_execute (const slang_assembly_file *);
+int _slang_execute2 (const slang_assembly_file *, slang_machine *);
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_execute_x86.c\r
- * x86 back end compiler\r
- * \author Michal Krol, Keith Whitwell\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_execute.h"\r
-#include "slang_library_noise.h"\r
-#include "slang_library_texsample.h"\r
-\r
-#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
-\r
-#include "x86/rtasm/x86sse.h"\r
-\r
-typedef struct\r
-{\r
- GLuint index;\r
- GLubyte *csr;\r
-} fixup;\r
-\r
-typedef struct\r
-{\r
- struct x86_function f;\r
- struct x86_reg r_eax;\r
- struct x86_reg r_ecx;\r
- struct x86_reg r_edx;\r
- struct x86_reg r_esp;\r
- struct x86_reg r_ebp;\r
- struct x86_reg r_st0;\r
- struct x86_reg r_st1;\r
- struct x86_reg r_st2;\r
- struct x86_reg r_st3;\r
- fixup *fixups;\r
- GLuint fixup_count;\r
- GLubyte **labels;\r
- slang_machine *mach;\r
- GLubyte *l_discard;\r
- GLubyte *l_exit;\r
- GLshort fpucntl;\r
-} codegen_ctx;\r
-\r
-static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr)\r
-{\r
- G->fixups = (fixup *) slang_alloc_realloc (G->fixups, G->fixup_count * sizeof (fixup),\r
- (G->fixup_count + 1) * sizeof (fixup));\r
- G->fixups[G->fixup_count].index = index;\r
- G->fixups[G->fixup_count].csr = csr;\r
- G->fixup_count++;\r
-}\r
-\r
-#ifdef NO_FAST_MATH\r
-#define RESTORE_FPU (DEFAULT_X86_FPU)\r
-#define RND_NEG_FPU (DEFAULT_X86_FPU | 0x400)\r
-#else\r
-#define RESTORE_FPU (FAST_X86_FPU)\r
-#define RND_NEG_FPU (FAST_X86_FPU | 0x400)\r
-#endif\r
-\r
-#if 0\r
-\r
-/*\r
- * XXX\r
- * These should produce a valid code that computes powers. Unfortunately, it does not.\r
- */\r
-static void set_fpu_round_neg_inf (codegen_ctx *G)\r
-{\r
- if (G->fpucntl != RND_NEG_FPU)\r
- {\r
- G->fpucntl = RND_NEG_FPU;\r
- x87_fnclex (&G->f);\r
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->x86.fpucntl_rnd_neg);\r
- x87_fldcw (&G->f, x86_deref (G->r_eax));\r
- }\r
-}\r
-\r
-static void emit_x87_ex2 (codegen_ctx *G)\r
-{\r
- set_fpu_round_neg_inf (G);\r
-\r
- x87_fld (&G->f, G->r_st0); /* a a */\r
- x87_fprndint (&G->f); /* int(a) a */\r
- x87_fld (&G->f, G->r_st0); /* int(a) int(a) a */\r
- x87_fstp (&G->f, G->r_st3); /* int(a) a int(a)*/\r
- x87_fsubp (&G->f, G->r_st1);/* frac(a) int(a) */\r
- x87_f2xm1 (&G->f); /* (2^frac(a))-1 int(a)*/\r
- x87_fld1 (&G->f); /* 1 (2^frac(a))-1 int(a)*/\r
- x87_faddp (&G->f, G->r_st1);/* 2^frac(a) int(a) */\r
- x87_fscale (&G->f); /* 2^a */\r
-}\r
-\r
-static void emit_pow (codegen_ctx *G)\r
-{\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));\r
- x87_fyl2x (&G->f);\r
- emit_x87_ex2 (G);\r
-}\r
-\r
-#endif\r
-\r
-static GLfloat do_ceilf (GLfloat x)\r
-{\r
- return CEILF (x);\r
-}\r
-\r
-static GLfloat do_floorf (GLfloat x)\r
-{\r
- return FLOORF (x);\r
-}\r
-\r
-static GLfloat do_powf (GLfloat y, GLfloat x)\r
-{\r
- return (GLfloat) _mesa_pow ((GLdouble) x, (GLdouble) y);\r
-}\r
-\r
-static GLvoid do_print_float (GLfloat x)\r
-{\r
- _mesa_printf ("slang print: %f\n", x);\r
-}\r
-\r
-static GLvoid do_print_int (GLfloat x)\r
-{\r
- _mesa_printf ("slang print: %d\n", (GLint) x);\r
-}\r
-\r
-static GLvoid do_print_bool (GLfloat x)\r
-{\r
- _mesa_printf ("slang print: %s\n", (GLint) x ? "true" : "false");\r
-}\r
-\r
-#define FLOAT_ONE 0x3f800000\r
-#define FLOAT_ZERO 0\r
-\r
-static GLvoid codegen_assem (codegen_ctx *G, slang_assembly *a)\r
-{\r
- GLint disp;\r
-\r
- switch (a->type)\r
- {\r
- case slang_asm_none:\r
- break;\r
- case slang_asm_float_copy:\r
- case slang_asm_int_copy:\r
- case slang_asm_bool_copy:\r
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0]));\r
- x86_pop (&G->f, G->r_ecx);\r
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx);\r
- break;\r
- case slang_asm_float_move:\r
- case slang_asm_int_move:\r
- case slang_asm_bool_move:\r
- x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[1]));\r
- x86_add (&G->f, G->r_eax, x86_deref (G->r_esp));\r
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));\r
- x86_mov (&G->f, x86_make_disp (G->r_esp, a->param[0]), G->r_eax);\r
- break;\r
- case slang_asm_float_push:\r
- case slang_asm_int_push:\r
- case slang_asm_bool_push:\r
- /* TODO: use push imm32 */\r
- x86_mov_reg_imm (&G->f, G->r_eax, *((GLint *) &a->literal));\r
- x86_push (&G->f, G->r_eax);\r
- break;\r
- case slang_asm_float_deref:\r
- case slang_asm_int_deref:\r
- case slang_asm_bool_deref:\r
- case slang_asm_addr_deref:\r
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));\r
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));\r
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);\r
- break;\r
- case slang_asm_float_add:\r
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_faddp (&G->f, G->r_st1);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_multiply:\r
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_fmulp (&G->f, G->r_st1);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_divide:\r
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_fdivp (&G->f, G->r_st1);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_negate:\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_fchs (&G->f);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_less:\r
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));\r
- x87_fcomp (&G->f, x86_deref (G->r_esp));\r
- x87_fnstsw (&G->f, G->r_eax);\r
- /* TODO: use test r8,imm8 */\r
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x100);\r
- x86_test (&G->f, G->r_eax, G->r_ecx);\r
- {\r
- GLubyte *lab0, *lab1;\r
-\r
- /* TODO: use jcc rel8 */\r
- lab0 = x86_jcc_forward (&G->f, cc_E);\r
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);\r
- /* TODO: use jmp rel8 */\r
- lab1 = x86_jmp_forward (&G->f);\r
- x86_fixup_fwd_jump (&G->f, lab0);\r
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);\r
- x86_fixup_fwd_jump (&G->f, lab1);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);\r
- }\r
- break;\r
- case slang_asm_float_equal_exp:\r
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));\r
- x87_fcomp (&G->f, x86_deref (G->r_esp));\r
- x87_fnstsw (&G->f, G->r_eax);\r
- /* TODO: use test r8,imm8 */\r
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);\r
- x86_test (&G->f, G->r_eax, G->r_ecx);\r
- {\r
- GLubyte *lab0, *lab1;\r
-\r
- /* TODO: use jcc rel8 */\r
- lab0 = x86_jcc_forward (&G->f, cc_E);\r
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);\r
- /* TODO: use jmp rel8 */\r
- lab1 = x86_jmp_forward (&G->f);\r
- x86_fixup_fwd_jump (&G->f, lab0);\r
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);\r
- x86_fixup_fwd_jump (&G->f, lab1);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);\r
- }\r
- break;\r
- case slang_asm_float_equal_int:\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4));\r
- x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4));\r
- x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4));\r
- x87_fnstsw (&G->f, G->r_eax);\r
- /* TODO: use test r8,imm8 */\r
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);\r
- x86_test (&G->f, G->r_eax, G->r_ecx);\r
- {\r
- GLubyte *lab0, *lab1;\r
-\r
- /* TODO: use jcc rel8 */\r
- lab0 = x86_jcc_forward (&G->f, cc_E);\r
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);\r
- /* TODO: use jmp rel8 */\r
- lab1 = x86_jmp_forward (&G->f);\r
- x86_fixup_fwd_jump (&G->f, lab0);\r
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);\r
- x86_fixup_fwd_jump (&G->f, lab1);\r
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);\r
- }\r
- break;\r
- case slang_asm_float_to_int:\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_fistp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_sine:\r
- /* TODO: use fsin */\r
- x86_call (&G->f, (GLubyte *) _mesa_sinf);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_arcsine:\r
- /* TODO: use fpatan (?) */\r
- x86_call (&G->f, (GLubyte *) _mesa_asinf);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_arctan:\r
- /* TODO: use fpatan */\r
- x86_call (&G->f, (GLubyte *) _mesa_atanf);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_power:\r
- /* TODO: use emit_pow() */\r
- x86_call (&G->f, (GLubyte *) do_powf);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_log2:\r
- x87_fld1 (&G->f);\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_fyl2x (&G->f);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_floor:\r
- x86_call (&G->f, (GLubyte *) do_floorf);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_ceil:\r
- x86_call (&G->f, (GLubyte *) do_ceilf);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_noise1:\r
- x86_call (&G->f, (GLubyte *) _slang_library_noise1);\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_noise2:\r
- x86_call (&G->f, (GLubyte *) _slang_library_noise2);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_noise3:\r
- x86_call (&G->f, (GLubyte *) _slang_library_noise4);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 8));\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_float_noise4:\r
- x86_call (&G->f, (GLubyte *) _slang_library_noise4);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));\r
- x87_fstp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_int_to_float:\r
- break;\r
- case slang_asm_int_to_addr:\r
- x87_fld (&G->f, x86_deref (G->r_esp));\r
- x87_fistp (&G->f, x86_deref (G->r_esp));\r
- break;\r
- case slang_asm_addr_copy:\r
- x86_pop (&G->f, G->r_eax);\r
- x86_mov (&G->f, G->r_ecx, x86_deref (G->r_esp));\r
- x86_mov (&G->f, x86_deref (G->r_ecx), G->r_eax);\r
- break;\r
- case slang_asm_addr_push:\r
- /* TODO: use push imm32 */\r
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) a->param[0]);\r
- x86_push (&G->f, G->r_eax);\r
- break;\r
- case slang_asm_addr_add:\r
- x86_pop (&G->f, G->r_eax);\r
- x86_add (&G->f, x86_deref (G->r_esp), G->r_eax);\r
- break;\r
- case slang_asm_addr_multiply:\r
- x86_pop (&G->f, G->r_ecx);\r
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));\r
- x86_mul (&G->f, G->r_ecx);\r
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);\r
- break;\r
- case slang_asm_vec4_tex1d:\r
- x86_call (&G->f, (GLubyte *) _slang_library_tex1d);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));\r
- break;\r
- case slang_asm_vec4_tex2d:\r
- x86_call (&G->f, (GLubyte *) _slang_library_tex2d);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));\r
- break;\r
- case slang_asm_vec4_tex3d:\r
- x86_call (&G->f, (GLubyte *) _slang_library_tex3d);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
- break;\r
- case slang_asm_vec4_texcube:\r
- x86_call (&G->f, (GLubyte *) _slang_library_texcube);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
- break;\r
- case slang_asm_vec4_shad1d:\r
- x86_call (&G->f, (GLubyte *) _slang_library_shad1d);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
- break;\r
- case slang_asm_vec4_shad2d:\r
- x86_call (&G->f, (GLubyte *) _slang_library_shad2d);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
- break;\r
- case slang_asm_jump:\r
- add_fixup (G, a->param[0], x86_jmp_forward (&G->f));\r
- break;\r
- case slang_asm_jump_if_zero:\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));\r
- x86_xor (&G->f, G->r_eax, G->r_eax);\r
- x86_cmp (&G->f, G->r_eax, x86_make_disp (G->r_esp, -4));\r
- {\r
- GLubyte *lab0;\r
-\r
- /* TODO: use jcc rel8 */\r
- lab0 = x86_jcc_forward (&G->f, cc_NE);\r
- add_fixup (G, a->param[0], x86_jmp_forward (&G->f));\r
- x86_fixup_fwd_jump (&G->f, lab0);\r
- }\r
- break;\r
- case slang_asm_enter:\r
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */\r
- assert (a->param[0] != 0);\r
- x86_push (&G->f, G->r_ebp);\r
- x86_lea (&G->f, G->r_ebp, x86_make_disp (G->r_esp, (GLint) a->param[0]));\r
- break;\r
- case slang_asm_leave:\r
- x86_pop (&G->f, G->r_ebp);\r
- break;\r
- case slang_asm_local_alloc:\r
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */\r
- assert (a->param[0] != 0);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -(GLint) a->param[0]));\r
- break;\r
- case slang_asm_local_free:\r
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */\r
- assert (a->param[0] != 0);\r
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, (GLint) a->param[0]));\r
- break;\r
- case slang_asm_local_addr:\r
- disp = -(GLint) (a->param[0] + a->param[1]) + 4;\r
- if (disp != 0)\r
- {\r
- x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_ebp, disp));\r
- x86_push (&G->f, G->r_eax);\r
- }\r
- else\r
- x86_push (&G->f, G->r_ebp);\r
- break;\r
- case slang_asm_global_addr:\r
- /* TODO: use push imm32 */\r
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->mem + a->param[0]);\r
- x86_push (&G->f, G->r_eax);\r
- break;\r
- case slang_asm_call:\r
- add_fixup (G, a->param[0], x86_call_forward (&G->f));\r
- break;\r
- case slang_asm_return:\r
- x86_ret (&G->f);\r
- break;\r
- case slang_asm_discard:\r
- x86_jmp (&G->f, G->l_discard);\r
- break;\r
- case slang_asm_exit:\r
- x86_jmp (&G->f, G->l_exit);\r
- break;\r
- /* mesa-specific extensions */\r
- case slang_asm_float_print:\r
- x86_call (&G->f, (GLubyte *) do_print_float);\r
- break;\r
- case slang_asm_int_print:\r
- x86_call (&G->f, (GLubyte *) do_print_int);\r
- break;\r
- case slang_asm_bool_print:\r
- x86_call (&G->f, (GLubyte *) do_print_bool);\r
- break;\r
- default:\r
- assert (0);\r
- }\r
-}\r
-\r
-GLboolean _slang_x86_codegen (slang_machine *mach, slang_assembly_file *file, GLuint start)\r
-{\r
- codegen_ctx G;\r
- GLubyte *j_body, *j_exit;\r
- GLuint i;\r
-\r
- /*\r
- * We need as much as 1M because *all* assembly, including built-in library, is\r
- * being translated to x86.\r
- * The built-in library occupies 450K, so we can be safe for now.\r
- * It is going to change in the future, when we get assembly analysis running.\r
- */\r
- x86_init_func_size (&G.f, 1048576);\r
- G.r_eax = x86_make_reg (file_REG32, reg_AX);\r
- G.r_ecx = x86_make_reg (file_REG32, reg_CX);\r
- G.r_edx = x86_make_reg (file_REG32, reg_DX);\r
- G.r_esp = x86_make_reg (file_REG32, reg_SP);\r
- G.r_ebp = x86_make_reg (file_REG32, reg_BP);\r
- G.r_st0 = x86_make_reg (file_x87, 0);\r
- G.r_st1 = x86_make_reg (file_x87, 1);\r
- G.r_st2 = x86_make_reg (file_x87, 2);\r
- G.r_st3 = x86_make_reg (file_x87, 3);\r
- G.fixups = NULL;\r
- G.fixup_count = 0;\r
- G.labels = (GLubyte **) slang_alloc_malloc (file->count * sizeof (GLubyte *));\r
- G.mach = mach;\r
- G.fpucntl = RESTORE_FPU;\r
-\r
- mach->x86.fpucntl_rnd_neg = RND_NEG_FPU;\r
- mach->x86.fpucntl_restore = RESTORE_FPU;\r
-\r
- /* prepare stack and jump to start */\r
- x86_push (&G.f, G.r_ebp);\r
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);\r
- x86_push (&G.f, G.r_esp);\r
- x86_pop (&G.f, G.r_ecx);\r
- x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);\r
- j_body = x86_jmp_forward (&G.f);\r
-\r
- /* "discard" instructions jump to this label */\r
- G.l_discard = x86_get_label (&G.f);\r
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->kill);\r
- x86_mov_reg_imm (&G.f, G.r_ecx, 1);\r
- x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);\r
- G.l_exit = x86_get_label (&G.f);\r
- j_exit = x86_jmp_forward (&G.f);\r
-\r
- for (i = 0; i < file->count; i++)\r
- {\r
- G.labels[i] = x86_get_label (&G.f);\r
- if (i == start)\r
- x86_fixup_fwd_jump (&G.f, j_body);\r
- codegen_assem (&G, &file->code[i]);\r
- }\r
-\r
- /*\r
- * Restore stack and return.\r
- * This must be handled this way, because "discard" can be invoked from any\r
- * place in the code.\r
- */\r
- x86_fixup_fwd_jump (&G.f, j_exit);\r
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);\r
- x86_mov (&G.f, G.r_esp, x86_deref (G.r_eax));\r
- x86_pop (&G.f, G.r_ebp);\r
- if (G.fpucntl != RESTORE_FPU)\r
- {\r
- x87_fnclex (&G.f);\r
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->x86.fpucntl_restore);\r
- x87_fldcw (&G.f, x86_deref (G.r_eax));\r
- }\r
- x86_ret (&G.f);\r
-\r
- /* fixup forward labels */\r
- for (i = 0; i < G.fixup_count; i++)\r
- {\r
- G.f.csr = G.labels[G.fixups[i].index];\r
- x86_fixup_fwd_jump (&G.f, G.fixups[i].csr);\r
- }\r
-\r
- slang_alloc_free (G.fixups);\r
- slang_alloc_free (G.labels);\r
-\r
- /* install new code */\r
- if (mach->x86.compiled_func != NULL)\r
- _mesa_exec_free (mach->x86.compiled_func);\r
- mach->x86.compiled_func = (GLvoid (*) (slang_machine *)) x86_get_func (&G.f);\r
-\r
- return GL_TRUE;\r
-}\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_execute_x86.c
+ * x86 back end compiler
+ * \author Michal Krol, Keith Whitwell
+ */
+
+#include "imports.h"
+#include "slang_execute.h"
+#include "slang_library_noise.h"
+#include "slang_library_texsample.h"
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+
+#include "x86/rtasm/x86sse.h"
+
+typedef struct
+{
+ GLuint index;
+ GLubyte *csr;
+} fixup;
+
+typedef struct
+{
+ struct x86_function f;
+ struct x86_reg r_eax;
+ struct x86_reg r_ecx;
+ struct x86_reg r_edx;
+ struct x86_reg r_esp;
+ struct x86_reg r_ebp;
+ struct x86_reg r_st0;
+ struct x86_reg r_st1;
+ struct x86_reg r_st2;
+ struct x86_reg r_st3;
+ fixup *fixups;
+ GLuint fixup_count;
+ GLubyte **labels;
+ slang_machine *mach;
+ GLubyte *l_discard;
+ GLubyte *l_exit;
+ GLshort fpucntl;
+} codegen_ctx;
+
+static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr)
+{
+ G->fixups = (fixup *) slang_alloc_realloc (G->fixups, G->fixup_count * sizeof (fixup),
+ (G->fixup_count + 1) * sizeof (fixup));
+ G->fixups[G->fixup_count].index = index;
+ G->fixups[G->fixup_count].csr = csr;
+ G->fixup_count++;
+}
+
+#ifdef NO_FAST_MATH
+#define RESTORE_FPU (DEFAULT_X86_FPU)
+#define RND_NEG_FPU (DEFAULT_X86_FPU | 0x400)
+#else
+#define RESTORE_FPU (FAST_X86_FPU)
+#define RND_NEG_FPU (FAST_X86_FPU | 0x400)
+#endif
+
+#if 0
+
+/*
+ * XXX
+ * These should produce a valid code that computes powers. Unfortunately, it does not.
+ */
+static void set_fpu_round_neg_inf (codegen_ctx *G)
+{
+ if (G->fpucntl != RND_NEG_FPU)
+ {
+ G->fpucntl = RND_NEG_FPU;
+ x87_fnclex (&G->f);
+ x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->x86.fpucntl_rnd_neg);
+ x87_fldcw (&G->f, x86_deref (G->r_eax));
+ }
+}
+
+static void emit_x87_ex2 (codegen_ctx *G)
+{
+ set_fpu_round_neg_inf (G);
+
+ x87_fld (&G->f, G->r_st0); /* a a */
+ x87_fprndint (&G->f); /* int(a) a */
+ x87_fld (&G->f, G->r_st0); /* int(a) int(a) a */
+ x87_fstp (&G->f, G->r_st3); /* int(a) a int(a)*/
+ x87_fsubp (&G->f, G->r_st1);/* frac(a) int(a) */
+ x87_f2xm1 (&G->f); /* (2^frac(a))-1 int(a)*/
+ x87_fld1 (&G->f); /* 1 (2^frac(a))-1 int(a)*/
+ x87_faddp (&G->f, G->r_st1);/* 2^frac(a) int(a) */
+ x87_fscale (&G->f); /* 2^a */
+}
+
+static void emit_pow (codegen_ctx *G)
+{
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fyl2x (&G->f);
+ emit_x87_ex2 (G);
+}
+
+#endif
+
+static GLfloat do_ceilf (GLfloat x)
+{
+ return CEILF (x);
+}
+
+static GLfloat do_floorf (GLfloat x)
+{
+ return FLOORF (x);
+}
+
+static GLfloat do_powf (GLfloat y, GLfloat x)
+{
+ return (GLfloat) _mesa_pow ((GLdouble) x, (GLdouble) y);
+}
+
+static GLvoid do_print_float (GLfloat x)
+{
+ _mesa_printf ("slang print: %f\n", x);
+}
+
+static GLvoid do_print_int (GLfloat x)
+{
+ _mesa_printf ("slang print: %d\n", (GLint) x);
+}
+
+static GLvoid do_print_bool (GLfloat x)
+{
+ _mesa_printf ("slang print: %s\n", (GLint) x ? "true" : "false");
+}
+
+#define FLOAT_ONE 0x3f800000
+#define FLOAT_ZERO 0
+
+static GLvoid codegen_assem (codegen_ctx *G, slang_assembly *a)
+{
+ GLint disp;
+
+ switch (a->type)
+ {
+ case slang_asm_none:
+ break;
+ case slang_asm_float_copy:
+ case slang_asm_int_copy:
+ case slang_asm_bool_copy:
+ x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0]));
+ x86_pop (&G->f, G->r_ecx);
+ x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx);
+ break;
+ case slang_asm_float_move:
+ case slang_asm_int_move:
+ case slang_asm_bool_move:
+ x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[1]));
+ x86_add (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
+ x86_mov (&G->f, x86_make_disp (G->r_esp, a->param[0]), G->r_eax);
+ break;
+ case slang_asm_float_push:
+ case slang_asm_int_push:
+ case slang_asm_bool_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm (&G->f, G->r_eax, *((GLint *) &a->literal));
+ x86_push (&G->f, G->r_eax);
+ break;
+ case slang_asm_float_deref:
+ case slang_asm_int_deref:
+ case slang_asm_bool_deref:
+ case slang_asm_addr_deref:
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
+ break;
+ case slang_asm_float_add:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_faddp (&G->f, G->r_st1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_multiply:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fmulp (&G->f, G->r_st1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_divide:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fdivp (&G->f, G->r_st1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_negate:
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fchs (&G->f);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_less:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fcomp (&G->f, x86_deref (G->r_esp));
+ x87_fnstsw (&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm (&G->f, G->r_ecx, 0x100);
+ x86_test (&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_E);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward (&G->f);
+ x86_fixup_fwd_jump (&G->f, lab0);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump (&G->f, lab1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_exp:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fcomp (&G->f, x86_deref (G->r_esp));
+ x87_fnstsw (&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
+ x86_test (&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_E);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward (&G->f);
+ x86_fixup_fwd_jump (&G->f, lab0);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump (&G->f, lab1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_int:
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4));
+ x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4));
+ x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4));
+ x87_fnstsw (&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
+ x86_test (&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_E);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward (&G->f);
+ x86_fixup_fwd_jump (&G->f, lab0);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump (&G->f, lab1);
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_to_int:
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fistp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_sine:
+ /* TODO: use fsin */
+ x86_call (&G->f, (GLubyte *) _mesa_sinf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_arcsine:
+ /* TODO: use fpatan (?) */
+ x86_call (&G->f, (GLubyte *) _mesa_asinf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_arctan:
+ /* TODO: use fpatan */
+ x86_call (&G->f, (GLubyte *) _mesa_atanf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_power:
+ /* TODO: use emit_pow() */
+ x86_call (&G->f, (GLubyte *) do_powf);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_log2:
+ x87_fld1 (&G->f);
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fyl2x (&G->f);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_floor:
+ x86_call (&G->f, (GLubyte *) do_floorf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_ceil:
+ x86_call (&G->f, (GLubyte *) do_ceilf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise1:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise1);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise2:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise2);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise3:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 8));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise4:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_int_to_float:
+ break;
+ case slang_asm_int_to_addr:
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fistp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_addr_copy:
+ x86_pop (&G->f, G->r_eax);
+ x86_mov (&G->f, G->r_ecx, x86_deref (G->r_esp));
+ x86_mov (&G->f, x86_deref (G->r_ecx), G->r_eax);
+ break;
+ case slang_asm_addr_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm (&G->f, G->r_eax, (GLint) a->param[0]);
+ x86_push (&G->f, G->r_eax);
+ break;
+ case slang_asm_addr_add:
+ x86_pop (&G->f, G->r_eax);
+ x86_add (&G->f, x86_deref (G->r_esp), G->r_eax);
+ break;
+ case slang_asm_addr_multiply:
+ x86_pop (&G->f, G->r_ecx);
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mul (&G->f, G->r_ecx);
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
+ break;
+ case slang_asm_vec4_tex1d:
+ x86_call (&G->f, (GLubyte *) _slang_library_tex1d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
+ break;
+ case slang_asm_vec4_tex2d:
+ x86_call (&G->f, (GLubyte *) _slang_library_tex2d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ break;
+ case slang_asm_vec4_tex3d:
+ x86_call (&G->f, (GLubyte *) _slang_library_tex3d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_vec4_texcube:
+ x86_call (&G->f, (GLubyte *) _slang_library_texcube);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad1d:
+ x86_call (&G->f, (GLubyte *) _slang_library_shad1d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad2d:
+ x86_call (&G->f, (GLubyte *) _slang_library_shad2d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_jump:
+ add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
+ break;
+ case slang_asm_jump_if_zero:
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_xor (&G->f, G->r_eax, G->r_eax);
+ x86_cmp (&G->f, G->r_eax, x86_make_disp (G->r_esp, -4));
+ {
+ GLubyte *lab0;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_NE);
+ add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
+ x86_fixup_fwd_jump (&G->f, lab0);
+ }
+ break;
+ case slang_asm_enter:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert (a->param[0] != 0);
+ x86_push (&G->f, G->r_ebp);
+ x86_lea (&G->f, G->r_ebp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_leave:
+ x86_pop (&G->f, G->r_ebp);
+ break;
+ case slang_asm_local_alloc:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert (a->param[0] != 0);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -(GLint) a->param[0]));
+ break;
+ case slang_asm_local_free:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert (a->param[0] != 0);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_local_addr:
+ disp = -(GLint) (a->param[0] + a->param[1]) + 4;
+ if (disp != 0)
+ {
+ x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_ebp, disp));
+ x86_push (&G->f, G->r_eax);
+ }
+ else
+ x86_push (&G->f, G->r_ebp);
+ break;
+ case slang_asm_global_addr:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->mem + a->param[0]);
+ x86_push (&G->f, G->r_eax);
+ break;
+ case slang_asm_call:
+ add_fixup (G, a->param[0], x86_call_forward (&G->f));
+ break;
+ case slang_asm_return:
+ x86_ret (&G->f);
+ break;
+ case slang_asm_discard:
+ x86_jmp (&G->f, G->l_discard);
+ break;
+ case slang_asm_exit:
+ x86_jmp (&G->f, G->l_exit);
+ break;
+ /* mesa-specific extensions */
+ case slang_asm_float_print:
+ x86_call (&G->f, (GLubyte *) do_print_float);
+ break;
+ case slang_asm_int_print:
+ x86_call (&G->f, (GLubyte *) do_print_int);
+ break;
+ case slang_asm_bool_print:
+ x86_call (&G->f, (GLubyte *) do_print_bool);
+ break;
+ default:
+ assert (0);
+ }
+}
+
+GLboolean _slang_x86_codegen (slang_machine *mach, slang_assembly_file *file, GLuint start)
+{
+ codegen_ctx G;
+ GLubyte *j_body, *j_exit;
+ GLuint i;
+
+ /*
+ * We need as much as 1M because *all* assembly, including built-in library, is
+ * being translated to x86.
+ * The built-in library occupies 450K, so we can be safe for now.
+ * It is going to change in the future, when we get assembly analysis running.
+ */
+ x86_init_func_size (&G.f, 1048576);
+ G.r_eax = x86_make_reg (file_REG32, reg_AX);
+ G.r_ecx = x86_make_reg (file_REG32, reg_CX);
+ G.r_edx = x86_make_reg (file_REG32, reg_DX);
+ G.r_esp = x86_make_reg (file_REG32, reg_SP);
+ G.r_ebp = x86_make_reg (file_REG32, reg_BP);
+ G.r_st0 = x86_make_reg (file_x87, 0);
+ G.r_st1 = x86_make_reg (file_x87, 1);
+ G.r_st2 = x86_make_reg (file_x87, 2);
+ G.r_st3 = x86_make_reg (file_x87, 3);
+ G.fixups = NULL;
+ G.fixup_count = 0;
+ G.labels = (GLubyte **) slang_alloc_malloc (file->count * sizeof (GLubyte *));
+ G.mach = mach;
+ G.fpucntl = RESTORE_FPU;
+
+ mach->x86.fpucntl_rnd_neg = RND_NEG_FPU;
+ mach->x86.fpucntl_restore = RESTORE_FPU;
+
+ /* prepare stack and jump to start */
+ x86_push (&G.f, G.r_ebp);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
+ x86_push (&G.f, G.r_esp);
+ x86_pop (&G.f, G.r_ecx);
+ x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
+ j_body = x86_jmp_forward (&G.f);
+
+ /* "discard" instructions jump to this label */
+ G.l_discard = x86_get_label (&G.f);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->kill);
+ x86_mov_reg_imm (&G.f, G.r_ecx, 1);
+ x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
+ G.l_exit = x86_get_label (&G.f);
+ j_exit = x86_jmp_forward (&G.f);
+
+ for (i = 0; i < file->count; i++)
+ {
+ G.labels[i] = x86_get_label (&G.f);
+ if (i == start)
+ x86_fixup_fwd_jump (&G.f, j_body);
+ codegen_assem (&G, &file->code[i]);
+ }
+
+ /*
+ * Restore stack and return.
+ * This must be handled this way, because "discard" can be invoked from any
+ * place in the code.
+ */
+ x86_fixup_fwd_jump (&G.f, j_exit);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
+ x86_mov (&G.f, G.r_esp, x86_deref (G.r_eax));
+ x86_pop (&G.f, G.r_ebp);
+ if (G.fpucntl != RESTORE_FPU)
+ {
+ x87_fnclex (&G.f);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->x86.fpucntl_restore);
+ x87_fldcw (&G.f, x86_deref (G.r_eax));
+ }
+ x86_ret (&G.f);
+
+ /* fixup forward labels */
+ for (i = 0; i < G.fixup_count; i++)
+ {
+ G.f.csr = G.labels[G.fixups[i].index];
+ x86_fixup_fwd_jump (&G.f, G.fixups[i].csr);
+ }
+
+ slang_alloc_free (G.fixups);
+ slang_alloc_free (G.labels);
+
+ /* install new code */
+ if (mach->x86.compiled_func != NULL)
+ _mesa_exec_free (mach->x86.compiled_func);
+ mach->x86.compiled_func = (GLvoid (*) (slang_machine *)) x86_get_func (&G.f);
+
+ return GL_TRUE;
+}
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/*\r
- * SimplexNoise1234\r
- * Copyright © 2003-2005, Stefan Gustavson\r
- *\r
- * Contact: stegu@itn.liu.se\r
- */\r
-\r
-/** \file\r
- \brief C implementation of Perlin Simplex Noise over 1,2,3, and 4 dimensions.\r
- \author Stefan Gustavson (stegu@itn.liu.se)\r
-*/\r
-\r
-/*\r
- * This implementation is "Simplex Noise" as presented by\r
- * Ken Perlin at a relatively obscure and not often cited course\r
- * session "Real-Time Shading" at Siggraph 2001 (before real\r
- * time shading actually took on), under the title "hardware noise".\r
- * The 3D function is numerically equivalent to his Java reference\r
- * code available in the PDF course notes, although I re-implemented\r
- * it from scratch to get more readable code. The 1D, 2D and 4D cases\r
- * were implemented from scratch by me from Ken Perlin's text.\r
- *\r
- * This file has no dependencies on any other file, not even its own\r
- * header file. The header file is made for use by external code only.\r
- */\r
-\r
-\r
-#include "imports.h"\r
-#include "slang_library_noise.h"\r
-\r
-#define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) )\r
-\r
-/*\r
- * ---------------------------------------------------------------------\r
- * Static data\r
- */\r
-\r
-/*\r
- * Permutation table. This is just a random jumble of all numbers 0-255,\r
- * repeated twice to avoid wrapping the index at 255 for each lookup.\r
- * This needs to be exactly the same for all instances on all platforms,\r
- * so it's easiest to just keep it as static explicit data.\r
- * This also removes the need for any initialisation of this class.\r
- *\r
- * Note that making this an int[] instead of a char[] might make the\r
- * code run faster on platforms with a high penalty for unaligned single\r
- * byte addressing. Intel x86 is generally single-byte-friendly, but\r
- * some other CPUs are faster with 4-aligned reads.\r
- * However, a char[] is smaller, which avoids cache trashing, and that\r
- * is probably the most important aspect on most architectures.\r
- * This array is accessed a *lot* by the noise functions.\r
- * A vector-valued noise over 3D accesses it 96 times, and a\r
- * float-valued 4D noise 64 times. We want this to fit in the cache!\r
- */\r
-unsigned char perm[512] = {151,160,137,91,90,15,\r
- 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,\r
- 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,\r
- 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,\r
- 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,\r
- 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,\r
- 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,\r
- 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,\r
- 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,\r
- 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,\r
- 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,\r
- 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,\r
- 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,\r
- 151,160,137,91,90,15,\r
- 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,\r
- 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,\r
- 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,\r
- 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,\r
- 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,\r
- 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,\r
- 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,\r
- 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,\r
- 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,\r
- 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,\r
- 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,\r
- 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180 \r
-};\r
-\r
-/*\r
- * ---------------------------------------------------------------------\r
- */\r
-\r
-/*\r
- * Helper functions to compute gradients-dot-residualvectors (1D to 4D)\r
- * Note that these generate gradients of more than unit length. To make\r
- * a close match with the value range of classic Perlin noise, the final\r
- * noise values need to be rescaled to fit nicely within [-1,1].\r
- * (The simplex noise functions as such also have different scaling.)\r
- * Note also that these noise functions are the most practical and useful\r
- * signed version of Perlin noise. To return values according to the\r
- * RenderMan specification from the SL noise() and pnoise() functions,\r
- * the noise values need to be scaled and offset to [0,1], like this:\r
- * float SLnoise = (SimplexNoise1234::noise(x,y,z) + 1.0) * 0.5;\r
- */\r
-\r
-static float grad1( int hash, float x ) {\r
- int h = hash & 15;\r
- float grad = 1.0f + (h & 7); /* Gradient value 1.0, 2.0, ..., 8.0 */\r
- if (h&8) grad = -grad; /* Set a random sign for the gradient */\r
- return ( grad * x ); /* Multiply the gradient with the distance */\r
-}\r
-\r
-static float grad2( int hash, float x, float y ) {\r
- int h = hash & 7; /* Convert low 3 bits of hash code */\r
- float u = h<4 ? x : y; /* into 8 simple gradient directions, */\r
- float v = h<4 ? y : x; /* and compute the dot product with (x,y). */\r
- return ((h&1)? -u : u) + ((h&2)? -2.0f*v : 2.0f*v);\r
-}\r
-\r
-static float grad3( int hash, float x, float y , float z ) {\r
- int h = hash & 15; /* Convert low 4 bits of hash code into 12 simple */\r
- float u = h<8 ? x : y; /* gradient directions, and compute dot product. */\r
- float v = h<4 ? y : h==12||h==14 ? x : z; /* Fix repeats at h = 12 to 15 */\r
- return ((h&1)? -u : u) + ((h&2)? -v : v);\r
-}\r
-\r
-static float grad4( int hash, float x, float y, float z, float t ) {\r
- int h = hash & 31; /* Convert low 5 bits of hash code into 32 simple */\r
- float u = h<24 ? x : y; /* gradient directions, and compute dot product. */\r
- float v = h<16 ? y : z;\r
- float w = h<8 ? z : t;\r
- return ((h&1)? -u : u) + ((h&2)? -v : v) + ((h&4)? -w : w);\r
-}\r
-\r
- /* A lookup table to traverse the simplex around a given point in 4D. */\r
- /* Details can be found where this table is used, in the 4D noise method. */\r
- /* TODO: This should not be required, backport it from Bill's GLSL code! */\r
- static unsigned char simplex[64][4] = {\r
- {0,1,2,3},{0,1,3,2},{0,0,0,0},{0,2,3,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,2,3,0},\r
- {0,2,1,3},{0,0,0,0},{0,3,1,2},{0,3,2,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,3,2,0},\r
- {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},\r
- {1,2,0,3},{0,0,0,0},{1,3,0,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,3,0,1},{2,3,1,0},\r
- {1,0,2,3},{1,0,3,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,0,3,1},{0,0,0,0},{2,1,3,0},\r
- {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},\r
- {2,0,1,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,0,1,2},{3,0,2,1},{0,0,0,0},{3,1,2,0},\r
- {2,1,0,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,1,0,2},{0,0,0,0},{3,2,0,1},{3,2,1,0}};\r
-\r
-/* 1D simplex noise */\r
-GLfloat _slang_library_noise1 (GLfloat x)\r
-{\r
- int i0 = FASTFLOOR(x);\r
- int i1 = i0 + 1;\r
- float x0 = x - i0;\r
- float x1 = x0 - 1.0f;\r
- float t1 = 1.0f - x1*x1;\r
- float n0, n1;\r
-\r
- float t0 = 1.0f - x0*x0;\r
-/* if(t0 < 0.0f) t0 = 0.0f; // this never happens for the 1D case */\r
- t0 *= t0;\r
- n0 = t0 * t0 * grad1(perm[i0 & 0xff], x0);\r
-\r
-/* if(t1 < 0.0f) t1 = 0.0f; // this never happens for the 1D case */\r
- t1 *= t1;\r
- n1 = t1 * t1 * grad1(perm[i1 & 0xff], x1);\r
- /* The maximum value of this noise is 8*(3/4)^4 = 2.53125 */\r
- /* A factor of 0.395 would scale to fit exactly within [-1,1], but */\r
- /* we want to match PRMan's 1D noise, so we scale it down some more. */\r
- return 0.25f * (n0 + n1);\r
-}\r
-\r
-/* 2D simplex noise */\r
-GLfloat _slang_library_noise2 (GLfloat x, GLfloat y)\r
-{\r
-#define F2 0.366025403f /* F2 = 0.5*(sqrt(3.0)-1.0) */\r
-#define G2 0.211324865f /* G2 = (3.0-Math.sqrt(3.0))/6.0 */\r
-\r
- float n0, n1, n2; /* Noise contributions from the three corners */\r
-\r
- /* Skew the input space to determine which simplex cell we're in */\r
- float s = (x+y)*F2; /* Hairy factor for 2D */\r
- float xs = x + s;\r
- float ys = y + s;\r
- int i = FASTFLOOR(xs);\r
- int j = FASTFLOOR(ys);\r
-\r
- float t = (float)(i+j)*G2;\r
- float X0 = i-t; /* Unskew the cell origin back to (x,y) space */\r
- float Y0 = j-t;\r
- float x0 = x-X0; /* The x,y distances from the cell origin */\r
- float y0 = y-Y0;\r
-\r
- float x1, y1, x2, y2;\r
- int ii, jj;\r
- float t0, t1, t2;\r
-\r
- /* For the 2D case, the simplex shape is an equilateral triangle. */\r
- /* Determine which simplex we are in. */\r
- int i1, j1; /* Offsets for second (middle) corner of simplex in (i,j) coords */\r
- if(x0>y0) {i1=1; j1=0;} /* lower triangle, XY order: (0,0)->(1,0)->(1,1) */\r
- else {i1=0; j1=1;} /* upper triangle, YX order: (0,0)->(0,1)->(1,1) */\r
-\r
- /* A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and */\r
- /* a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where */\r
- /* c = (3-sqrt(3))/6 */\r
-\r
- x1 = x0 - i1 + G2; /* Offsets for middle corner in (x,y) unskewed coords */\r
- y1 = y0 - j1 + G2;\r
- x2 = x0 - 1.0f + 2.0f * G2; /* Offsets for last corner in (x,y) unskewed coords */\r
- y2 = y0 - 1.0f + 2.0f * G2;\r
-\r
- /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */\r
- ii = i % 256;\r
- jj = j % 256;\r
-\r
- /* Calculate the contribution from the three corners */\r
- t0 = 0.5f - x0*x0-y0*y0;\r
- if(t0 < 0.0f) n0 = 0.0f;\r
- else {\r
- t0 *= t0;\r
- n0 = t0 * t0 * grad2(perm[ii+perm[jj]], x0, y0); \r
- }\r
-\r
- t1 = 0.5f - x1*x1-y1*y1;\r
- if(t1 < 0.0f) n1 = 0.0f;\r
- else {\r
- t1 *= t1;\r
- n1 = t1 * t1 * grad2(perm[ii+i1+perm[jj+j1]], x1, y1);\r
- }\r
-\r
- t2 = 0.5f - x2*x2-y2*y2;\r
- if(t2 < 0.0f) n2 = 0.0f;\r
- else {\r
- t2 *= t2;\r
- n2 = t2 * t2 * grad2(perm[ii+1+perm[jj+1]], x2, y2);\r
- }\r
-\r
- /* Add contributions from each corner to get the final noise value. */\r
- /* The result is scaled to return values in the interval [-1,1]. */\r
- return 40.0f * (n0 + n1 + n2); /* TODO: The scale factor is preliminary! */\r
-}\r
-\r
-/* 3D simplex noise */\r
-GLfloat _slang_library_noise3 (GLfloat x, GLfloat y, GLfloat z)\r
-{\r
-/* Simple skewing factors for the 3D case */\r
-#define F3 0.333333333f\r
-#define G3 0.166666667f\r
-\r
- float n0, n1, n2, n3; /* Noise contributions from the four corners */\r
-\r
- /* Skew the input space to determine which simplex cell we're in */\r
- float s = (x+y+z)*F3; /* Very nice and simple skew factor for 3D */\r
- float xs = x+s;\r
- float ys = y+s;\r
- float zs = z+s;\r
- int i = FASTFLOOR(xs);\r
- int j = FASTFLOOR(ys);\r
- int k = FASTFLOOR(zs);\r
-\r
- float t = (float)(i+j+k)*G3; \r
- float X0 = i-t; /* Unskew the cell origin back to (x,y,z) space */\r
- float Y0 = j-t;\r
- float Z0 = k-t;\r
- float x0 = x-X0; /* The x,y,z distances from the cell origin */\r
- float y0 = y-Y0;\r
- float z0 = z-Z0;\r
-\r
- float x1, y1, z1, x2, y2, z2, x3, y3, z3;\r
- int ii, jj, kk;\r
- float t0, t1, t2, t3;\r
-\r
- /* For the 3D case, the simplex shape is a slightly irregular tetrahedron. */\r
- /* Determine which simplex we are in. */\r
- int i1, j1, k1; /* Offsets for second corner of simplex in (i,j,k) coords */\r
- int i2, j2, k2; /* Offsets for third corner of simplex in (i,j,k) coords */\r
-\r
-/* This code would benefit from a backport from the GLSL version! */\r
- if(x0>=y0) {\r
- if(y0>=z0)\r
- { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } /* X Y Z order */\r
- else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } /* X Z Y order */\r
- else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } /* Z X Y order */\r
- }\r
- else { /* x0<y0 */\r
- if(y0<z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; } /* Z Y X order */\r
- else if(x0<z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; } /* Y Z X order */\r
- else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; } /* Y X Z order */\r
- }\r
-\r
- /* A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z), */\r
- /* a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and */\r
- /* a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where */\r
- /* c = 1/6. */\r
-\r
- x1 = x0 - i1 + G3; /* Offsets for second corner in (x,y,z) coords */\r
- y1 = y0 - j1 + G3;\r
- z1 = z0 - k1 + G3;\r
- x2 = x0 - i2 + 2.0f*G3; /* Offsets for third corner in (x,y,z) coords */\r
- y2 = y0 - j2 + 2.0f*G3;\r
- z2 = z0 - k2 + 2.0f*G3;\r
- x3 = x0 - 1.0f + 3.0f*G3; /* Offsets for last corner in (x,y,z) coords */\r
- y3 = y0 - 1.0f + 3.0f*G3;\r
- z3 = z0 - 1.0f + 3.0f*G3;\r
-\r
- /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */\r
- ii = i % 256;\r
- jj = j % 256;\r
- kk = k % 256;\r
-\r
- /* Calculate the contribution from the four corners */\r
- t0 = 0.6f - x0*x0 - y0*y0 - z0*z0;\r
- if(t0 < 0.0f) n0 = 0.0f;\r
- else {\r
- t0 *= t0;\r
- n0 = t0 * t0 * grad3(perm[ii+perm[jj+perm[kk]]], x0, y0, z0);\r
- }\r
-\r
- t1 = 0.6f - x1*x1 - y1*y1 - z1*z1;\r
- if(t1 < 0.0f) n1 = 0.0f;\r
- else {\r
- t1 *= t1;\r
- n1 = t1 * t1 * grad3(perm[ii+i1+perm[jj+j1+perm[kk+k1]]], x1, y1, z1);\r
- }\r
-\r
- t2 = 0.6f - x2*x2 - y2*y2 - z2*z2;\r
- if(t2 < 0.0f) n2 = 0.0f;\r
- else {\r
- t2 *= t2;\r
- n2 = t2 * t2 * grad3(perm[ii+i2+perm[jj+j2+perm[kk+k2]]], x2, y2, z2);\r
- }\r
-\r
- t3 = 0.6f - x3*x3 - y3*y3 - z3*z3;\r
- if(t3<0.0f) n3 = 0.0f;\r
- else {\r
- t3 *= t3;\r
- n3 = t3 * t3 * grad3(perm[ii+1+perm[jj+1+perm[kk+1]]], x3, y3, z3);\r
- }\r
-\r
- /* Add contributions from each corner to get the final noise value. */\r
- /* The result is scaled to stay just inside [-1,1] */\r
- return 32.0f * (n0 + n1 + n2 + n3); /* TODO: The scale factor is preliminary! */\r
-}\r
-\r
-/* 4D simplex noise */\r
-GLfloat _slang_library_noise4 (GLfloat x, GLfloat y, GLfloat z, GLfloat w)\r
-{\r
- /* The skewing and unskewing factors are hairy again for the 4D case */\r
-#define F4 0.309016994f /* F4 = (Math.sqrt(5.0)-1.0)/4.0 */\r
-#define G4 0.138196601f /* G4 = (5.0-Math.sqrt(5.0))/20.0 */\r
-\r
- float n0, n1, n2, n3, n4; /* Noise contributions from the five corners */\r
-\r
- /* Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in */\r
- float s = (x + y + z + w) * F4; /* Factor for 4D skewing */\r
- float xs = x + s;\r
- float ys = y + s;\r
- float zs = z + s;\r
- float ws = w + s;\r
- int i = FASTFLOOR(xs);\r
- int j = FASTFLOOR(ys);\r
- int k = FASTFLOOR(zs);\r
- int l = FASTFLOOR(ws);\r
-\r
- float t = (i + j + k + l) * G4; /* Factor for 4D unskewing */\r
- float X0 = i - t; /* Unskew the cell origin back to (x,y,z,w) space */\r
- float Y0 = j - t;\r
- float Z0 = k - t;\r
- float W0 = l - t;\r
-\r
- float x0 = x - X0; /* The x,y,z,w distances from the cell origin */\r
- float y0 = y - Y0;\r
- float z0 = z - Z0;\r
- float w0 = w - W0;\r
-\r
- /* For the 4D case, the simplex is a 4D shape I won't even try to describe. */\r
- /* To find out which of the 24 possible simplices we're in, we need to */\r
- /* determine the magnitude ordering of x0, y0, z0 and w0. */\r
- /* The method below is a good way of finding the ordering of x,y,z,w and */\r
- /* then find the correct traversal order for the simplex we\92re in. */\r
- /* First, six pair-wise comparisons are performed between each possible pair */\r
- /* of the four coordinates, and the results are used to add up binary bits */\r
- /* for an integer index. */\r
- int c1 = (x0 > y0) ? 32 : 0;\r
- int c2 = (x0 > z0) ? 16 : 0;\r
- int c3 = (y0 > z0) ? 8 : 0;\r
- int c4 = (x0 > w0) ? 4 : 0;\r
- int c5 = (y0 > w0) ? 2 : 0;\r
- int c6 = (z0 > w0) ? 1 : 0;\r
- int c = c1 + c2 + c3 + c4 + c5 + c6;\r
-\r
- int i1, j1, k1, l1; /* The integer offsets for the second simplex corner */\r
- int i2, j2, k2, l2; /* The integer offsets for the third simplex corner */\r
- int i3, j3, k3, l3; /* The integer offsets for the fourth simplex corner */\r
-\r
- float x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3, x4, y4, z4, w4;\r
- int ii, jj, kk, ll;\r
- float t0, t1, t2, t3, t4;\r
-\r
- /* simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. */\r
- /* Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w */\r
- /* impossible. Only the 24 indices which have non-zero entries make any sense. */\r
- /* We use a thresholding to set the coordinates in turn from the largest magnitude. */\r
- /* The number 3 in the "simplex" array is at the position of the largest coordinate. */\r
- i1 = simplex[c][0]>=3 ? 1 : 0;\r
- j1 = simplex[c][1]>=3 ? 1 : 0;\r
- k1 = simplex[c][2]>=3 ? 1 : 0;\r
- l1 = simplex[c][3]>=3 ? 1 : 0;\r
- /* The number 2 in the "simplex" array is at the second largest coordinate. */\r
- i2 = simplex[c][0]>=2 ? 1 : 0;\r
- j2 = simplex[c][1]>=2 ? 1 : 0;\r
- k2 = simplex[c][2]>=2 ? 1 : 0;\r
- l2 = simplex[c][3]>=2 ? 1 : 0;\r
- /* The number 1 in the "simplex" array is at the second smallest coordinate. */\r
- i3 = simplex[c][0]>=1 ? 1 : 0;\r
- j3 = simplex[c][1]>=1 ? 1 : 0;\r
- k3 = simplex[c][2]>=1 ? 1 : 0;\r
- l3 = simplex[c][3]>=1 ? 1 : 0;\r
- /* The fifth corner has all coordinate offsets = 1, so no need to look that up. */\r
-\r
- x1 = x0 - i1 + G4; /* Offsets for second corner in (x,y,z,w) coords */\r
- y1 = y0 - j1 + G4;\r
- z1 = z0 - k1 + G4;\r
- w1 = w0 - l1 + G4;\r
- x2 = x0 - i2 + 2.0f*G4; /* Offsets for third corner in (x,y,z,w) coords */\r
- y2 = y0 - j2 + 2.0f*G4;\r
- z2 = z0 - k2 + 2.0f*G4;\r
- w2 = w0 - l2 + 2.0f*G4;\r
- x3 = x0 - i3 + 3.0f*G4; /* Offsets for fourth corner in (x,y,z,w) coords */\r
- y3 = y0 - j3 + 3.0f*G4;\r
- z3 = z0 - k3 + 3.0f*G4;\r
- w3 = w0 - l3 + 3.0f*G4;\r
- x4 = x0 - 1.0f + 4.0f*G4; /* Offsets for last corner in (x,y,z,w) coords */\r
- y4 = y0 - 1.0f + 4.0f*G4;\r
- z4 = z0 - 1.0f + 4.0f*G4;\r
- w4 = w0 - 1.0f + 4.0f*G4;\r
-\r
- /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */\r
- ii = i % 256;\r
- jj = j % 256;\r
- kk = k % 256;\r
- ll = l % 256;\r
-\r
- /* Calculate the contribution from the five corners */\r
- t0 = 0.6f - x0*x0 - y0*y0 - z0*z0 - w0*w0;\r
- if(t0 < 0.0f) n0 = 0.0f;\r
- else {\r
- t0 *= t0;\r
- n0 = t0 * t0 * grad4(perm[ii+perm[jj+perm[kk+perm[ll]]]], x0, y0, z0, w0);\r
- }\r
-\r
- t1 = 0.6f - x1*x1 - y1*y1 - z1*z1 - w1*w1;\r
- if(t1 < 0.0f) n1 = 0.0f;\r
- else {\r
- t1 *= t1;\r
- n1 = t1 * t1 * grad4(perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]], x1, y1, z1, w1);\r
- }\r
-\r
- t2 = 0.6f - x2*x2 - y2*y2 - z2*z2 - w2*w2;\r
- if(t2 < 0.0f) n2 = 0.0f;\r
- else {\r
- t2 *= t2;\r
- n2 = t2 * t2 * grad4(perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]], x2, y2, z2, w2);\r
- }\r
-\r
- t3 = 0.6f - x3*x3 - y3*y3 - z3*z3 - w3*w3;\r
- if(t3 < 0.0f) n3 = 0.0f;\r
- else {\r
- t3 *= t3;\r
- n3 = t3 * t3 * grad4(perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]], x3, y3, z3, w3);\r
- }\r
-\r
- t4 = 0.6f - x4*x4 - y4*y4 - z4*z4 - w4*w4;\r
- if(t4 < 0.0f) n4 = 0.0f;\r
- else {\r
- t4 *= t4;\r
- n4 = t4 * t4 * grad4(perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]], x4, y4, z4, w4);\r
- }\r
-\r
- /* Sum up and scale the result to cover the range [-1,1] */\r
- return 27.0f * (n0 + n1 + n2 + n3 + n4); /* TODO: The scale factor is preliminary! */\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+/*
+ * SimplexNoise1234
+ * Copyright © 2003-2005, Stefan Gustavson
+ *
+ * Contact: stegu@itn.liu.se
+ */
+
+/** \file
+ \brief C implementation of Perlin Simplex Noise over 1,2,3, and 4 dimensions.
+ \author Stefan Gustavson (stegu@itn.liu.se)
+*/
+
+/*
+ * This implementation is "Simplex Noise" as presented by
+ * Ken Perlin at a relatively obscure and not often cited course
+ * session "Real-Time Shading" at Siggraph 2001 (before real
+ * time shading actually took on), under the title "hardware noise".
+ * The 3D function is numerically equivalent to his Java reference
+ * code available in the PDF course notes, although I re-implemented
+ * it from scratch to get more readable code. The 1D, 2D and 4D cases
+ * were implemented from scratch by me from Ken Perlin's text.
+ *
+ * This file has no dependencies on any other file, not even its own
+ * header file. The header file is made for use by external code only.
+ */
+
+
+#include "imports.h"
+#include "slang_library_noise.h"
+
+#define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) )
+
+/*
+ * ---------------------------------------------------------------------
+ * Static data
+ */
+
+/*
+ * Permutation table. This is just a random jumble of all numbers 0-255,
+ * repeated twice to avoid wrapping the index at 255 for each lookup.
+ * This needs to be exactly the same for all instances on all platforms,
+ * so it's easiest to just keep it as static explicit data.
+ * This also removes the need for any initialisation of this class.
+ *
+ * Note that making this an int[] instead of a char[] might make the
+ * code run faster on platforms with a high penalty for unaligned single
+ * byte addressing. Intel x86 is generally single-byte-friendly, but
+ * some other CPUs are faster with 4-aligned reads.
+ * However, a char[] is smaller, which avoids cache trashing, and that
+ * is probably the most important aspect on most architectures.
+ * This array is accessed a *lot* by the noise functions.
+ * A vector-valued noise over 3D accesses it 96 times, and a
+ * float-valued 4D noise 64 times. We want this to fit in the cache!
+ */
+unsigned char perm[512] = {151,160,137,91,90,15,
+ 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
+ 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
+ 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
+ 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
+ 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
+ 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
+ 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
+ 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
+ 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
+ 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
+ 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
+ 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,
+ 151,160,137,91,90,15,
+ 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
+ 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
+ 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
+ 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
+ 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
+ 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
+ 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
+ 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
+ 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
+ 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
+ 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
+ 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180
+};
+
+/*
+ * ---------------------------------------------------------------------
+ */
+
+/*
+ * Helper functions to compute gradients-dot-residualvectors (1D to 4D)
+ * Note that these generate gradients of more than unit length. To make
+ * a close match with the value range of classic Perlin noise, the final
+ * noise values need to be rescaled to fit nicely within [-1,1].
+ * (The simplex noise functions as such also have different scaling.)
+ * Note also that these noise functions are the most practical and useful
+ * signed version of Perlin noise. To return values according to the
+ * RenderMan specification from the SL noise() and pnoise() functions,
+ * the noise values need to be scaled and offset to [0,1], like this:
+ * float SLnoise = (SimplexNoise1234::noise(x,y,z) + 1.0) * 0.5;
+ */
+
+static float grad1( int hash, float x ) {
+ int h = hash & 15;
+ float grad = 1.0f + (h & 7); /* Gradient value 1.0, 2.0, ..., 8.0 */
+ if (h&8) grad = -grad; /* Set a random sign for the gradient */
+ return ( grad * x ); /* Multiply the gradient with the distance */
+}
+
+static float grad2( int hash, float x, float y ) {
+ int h = hash & 7; /* Convert low 3 bits of hash code */
+ float u = h<4 ? x : y; /* into 8 simple gradient directions, */
+ float v = h<4 ? y : x; /* and compute the dot product with (x,y). */
+ return ((h&1)? -u : u) + ((h&2)? -2.0f*v : 2.0f*v);
+}
+
+static float grad3( int hash, float x, float y , float z ) {
+ int h = hash & 15; /* Convert low 4 bits of hash code into 12 simple */
+ float u = h<8 ? x : y; /* gradient directions, and compute dot product. */
+ float v = h<4 ? y : h==12||h==14 ? x : z; /* Fix repeats at h = 12 to 15 */
+ return ((h&1)? -u : u) + ((h&2)? -v : v);
+}
+
+static float grad4( int hash, float x, float y, float z, float t ) {
+ int h = hash & 31; /* Convert low 5 bits of hash code into 32 simple */
+ float u = h<24 ? x : y; /* gradient directions, and compute dot product. */
+ float v = h<16 ? y : z;
+ float w = h<8 ? z : t;
+ return ((h&1)? -u : u) + ((h&2)? -v : v) + ((h&4)? -w : w);
+}
+
+ /* A lookup table to traverse the simplex around a given point in 4D. */
+ /* Details can be found where this table is used, in the 4D noise method. */
+ /* TODO: This should not be required, backport it from Bill's GLSL code! */
+ static unsigned char simplex[64][4] = {
+ {0,1,2,3},{0,1,3,2},{0,0,0,0},{0,2,3,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,2,3,0},
+ {0,2,1,3},{0,0,0,0},{0,3,1,2},{0,3,2,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,3,2,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},
+ {1,2,0,3},{0,0,0,0},{1,3,0,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,3,0,1},{2,3,1,0},
+ {1,0,2,3},{1,0,3,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,0,3,1},{0,0,0,0},{2,1,3,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},
+ {2,0,1,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,0,1,2},{3,0,2,1},{0,0,0,0},{3,1,2,0},
+ {2,1,0,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,1,0,2},{0,0,0,0},{3,2,0,1},{3,2,1,0}};
+
+/* 1D simplex noise */
+GLfloat _slang_library_noise1 (GLfloat x)
+{
+ int i0 = FASTFLOOR(x);
+ int i1 = i0 + 1;
+ float x0 = x - i0;
+ float x1 = x0 - 1.0f;
+ float t1 = 1.0f - x1*x1;
+ float n0, n1;
+
+ float t0 = 1.0f - x0*x0;
+/* if(t0 < 0.0f) t0 = 0.0f; // this never happens for the 1D case */
+ t0 *= t0;
+ n0 = t0 * t0 * grad1(perm[i0 & 0xff], x0);
+
+/* if(t1 < 0.0f) t1 = 0.0f; // this never happens for the 1D case */
+ t1 *= t1;
+ n1 = t1 * t1 * grad1(perm[i1 & 0xff], x1);
+ /* The maximum value of this noise is 8*(3/4)^4 = 2.53125 */
+ /* A factor of 0.395 would scale to fit exactly within [-1,1], but */
+ /* we want to match PRMan's 1D noise, so we scale it down some more. */
+ return 0.25f * (n0 + n1);
+}
+
+/* 2D simplex noise */
+GLfloat _slang_library_noise2 (GLfloat x, GLfloat y)
+{
+#define F2 0.366025403f /* F2 = 0.5*(sqrt(3.0)-1.0) */
+#define G2 0.211324865f /* G2 = (3.0-Math.sqrt(3.0))/6.0 */
+
+ float n0, n1, n2; /* Noise contributions from the three corners */
+
+ /* Skew the input space to determine which simplex cell we're in */
+ float s = (x+y)*F2; /* Hairy factor for 2D */
+ float xs = x + s;
+ float ys = y + s;
+ int i = FASTFLOOR(xs);
+ int j = FASTFLOOR(ys);
+
+ float t = (float)(i+j)*G2;
+ float X0 = i-t; /* Unskew the cell origin back to (x,y) space */
+ float Y0 = j-t;
+ float x0 = x-X0; /* The x,y distances from the cell origin */
+ float y0 = y-Y0;
+
+ float x1, y1, x2, y2;
+ int ii, jj;
+ float t0, t1, t2;
+
+ /* For the 2D case, the simplex shape is an equilateral triangle. */
+ /* Determine which simplex we are in. */
+ int i1, j1; /* Offsets for second (middle) corner of simplex in (i,j) coords */
+ if(x0>y0) {i1=1; j1=0;} /* lower triangle, XY order: (0,0)->(1,0)->(1,1) */
+ else {i1=0; j1=1;} /* upper triangle, YX order: (0,0)->(0,1)->(1,1) */
+
+ /* A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and */
+ /* a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where */
+ /* c = (3-sqrt(3))/6 */
+
+ x1 = x0 - i1 + G2; /* Offsets for middle corner in (x,y) unskewed coords */
+ y1 = y0 - j1 + G2;
+ x2 = x0 - 1.0f + 2.0f * G2; /* Offsets for last corner in (x,y) unskewed coords */
+ y2 = y0 - 1.0f + 2.0f * G2;
+
+ /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */
+ ii = i % 256;
+ jj = j % 256;
+
+ /* Calculate the contribution from the three corners */
+ t0 = 0.5f - x0*x0-y0*y0;
+ if(t0 < 0.0f) n0 = 0.0f;
+ else {
+ t0 *= t0;
+ n0 = t0 * t0 * grad2(perm[ii+perm[jj]], x0, y0);
+ }
+
+ t1 = 0.5f - x1*x1-y1*y1;
+ if(t1 < 0.0f) n1 = 0.0f;
+ else {
+ t1 *= t1;
+ n1 = t1 * t1 * grad2(perm[ii+i1+perm[jj+j1]], x1, y1);
+ }
+
+ t2 = 0.5f - x2*x2-y2*y2;
+ if(t2 < 0.0f) n2 = 0.0f;
+ else {
+ t2 *= t2;
+ n2 = t2 * t2 * grad2(perm[ii+1+perm[jj+1]], x2, y2);
+ }
+
+ /* Add contributions from each corner to get the final noise value. */
+ /* The result is scaled to return values in the interval [-1,1]. */
+ return 40.0f * (n0 + n1 + n2); /* TODO: The scale factor is preliminary! */
+}
+
+/* 3D simplex noise */
+GLfloat _slang_library_noise3 (GLfloat x, GLfloat y, GLfloat z)
+{
+/* Simple skewing factors for the 3D case */
+#define F3 0.333333333f
+#define G3 0.166666667f
+
+ float n0, n1, n2, n3; /* Noise contributions from the four corners */
+
+ /* Skew the input space to determine which simplex cell we're in */
+ float s = (x+y+z)*F3; /* Very nice and simple skew factor for 3D */
+ float xs = x+s;
+ float ys = y+s;
+ float zs = z+s;
+ int i = FASTFLOOR(xs);
+ int j = FASTFLOOR(ys);
+ int k = FASTFLOOR(zs);
+
+ float t = (float)(i+j+k)*G3;
+ float X0 = i-t; /* Unskew the cell origin back to (x,y,z) space */
+ float Y0 = j-t;
+ float Z0 = k-t;
+ float x0 = x-X0; /* The x,y,z distances from the cell origin */
+ float y0 = y-Y0;
+ float z0 = z-Z0;
+
+ float x1, y1, z1, x2, y2, z2, x3, y3, z3;
+ int ii, jj, kk;
+ float t0, t1, t2, t3;
+
+ /* For the 3D case, the simplex shape is a slightly irregular tetrahedron. */
+ /* Determine which simplex we are in. */
+ int i1, j1, k1; /* Offsets for second corner of simplex in (i,j,k) coords */
+ int i2, j2, k2; /* Offsets for third corner of simplex in (i,j,k) coords */
+
+/* This code would benefit from a backport from the GLSL version! */
+ if(x0>=y0) {
+ if(y0>=z0)
+ { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } /* X Y Z order */
+ else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } /* X Z Y order */
+ else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } /* Z X Y order */
+ }
+ else { /* x0<y0 */
+ if(y0<z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; } /* Z Y X order */
+ else if(x0<z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; } /* Y Z X order */
+ else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; } /* Y X Z order */
+ }
+
+ /* A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z), */
+ /* a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and */
+ /* a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where */
+ /* c = 1/6. */
+
+ x1 = x0 - i1 + G3; /* Offsets for second corner in (x,y,z) coords */
+ y1 = y0 - j1 + G3;
+ z1 = z0 - k1 + G3;
+ x2 = x0 - i2 + 2.0f*G3; /* Offsets for third corner in (x,y,z) coords */
+ y2 = y0 - j2 + 2.0f*G3;
+ z2 = z0 - k2 + 2.0f*G3;
+ x3 = x0 - 1.0f + 3.0f*G3; /* Offsets for last corner in (x,y,z) coords */
+ y3 = y0 - 1.0f + 3.0f*G3;
+ z3 = z0 - 1.0f + 3.0f*G3;
+
+ /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */
+ ii = i % 256;
+ jj = j % 256;
+ kk = k % 256;
+
+ /* Calculate the contribution from the four corners */
+ t0 = 0.6f - x0*x0 - y0*y0 - z0*z0;
+ if(t0 < 0.0f) n0 = 0.0f;
+ else {
+ t0 *= t0;
+ n0 = t0 * t0 * grad3(perm[ii+perm[jj+perm[kk]]], x0, y0, z0);
+ }
+
+ t1 = 0.6f - x1*x1 - y1*y1 - z1*z1;
+ if(t1 < 0.0f) n1 = 0.0f;
+ else {
+ t1 *= t1;
+ n1 = t1 * t1 * grad3(perm[ii+i1+perm[jj+j1+perm[kk+k1]]], x1, y1, z1);
+ }
+
+ t2 = 0.6f - x2*x2 - y2*y2 - z2*z2;
+ if(t2 < 0.0f) n2 = 0.0f;
+ else {
+ t2 *= t2;
+ n2 = t2 * t2 * grad3(perm[ii+i2+perm[jj+j2+perm[kk+k2]]], x2, y2, z2);
+ }
+
+ t3 = 0.6f - x3*x3 - y3*y3 - z3*z3;
+ if(t3<0.0f) n3 = 0.0f;
+ else {
+ t3 *= t3;
+ n3 = t3 * t3 * grad3(perm[ii+1+perm[jj+1+perm[kk+1]]], x3, y3, z3);
+ }
+
+ /* Add contributions from each corner to get the final noise value. */
+ /* The result is scaled to stay just inside [-1,1] */
+ return 32.0f * (n0 + n1 + n2 + n3); /* TODO: The scale factor is preliminary! */
+}
+
+/* 4D simplex noise */
+GLfloat _slang_library_noise4 (GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ /* The skewing and unskewing factors are hairy again for the 4D case */
+#define F4 0.309016994f /* F4 = (Math.sqrt(5.0)-1.0)/4.0 */
+#define G4 0.138196601f /* G4 = (5.0-Math.sqrt(5.0))/20.0 */
+
+ float n0, n1, n2, n3, n4; /* Noise contributions from the five corners */
+
+ /* Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in */
+ float s = (x + y + z + w) * F4; /* Factor for 4D skewing */
+ float xs = x + s;
+ float ys = y + s;
+ float zs = z + s;
+ float ws = w + s;
+ int i = FASTFLOOR(xs);
+ int j = FASTFLOOR(ys);
+ int k = FASTFLOOR(zs);
+ int l = FASTFLOOR(ws);
+
+ float t = (i + j + k + l) * G4; /* Factor for 4D unskewing */
+ float X0 = i - t; /* Unskew the cell origin back to (x,y,z,w) space */
+ float Y0 = j - t;
+ float Z0 = k - t;
+ float W0 = l - t;
+
+ float x0 = x - X0; /* The x,y,z,w distances from the cell origin */
+ float y0 = y - Y0;
+ float z0 = z - Z0;
+ float w0 = w - W0;
+
+ /* For the 4D case, the simplex is a 4D shape I won't even try to describe. */
+ /* To find out which of the 24 possible simplices we're in, we need to */
+ /* determine the magnitude ordering of x0, y0, z0 and w0. */
+ /* The method below is a good way of finding the ordering of x,y,z,w and */
+ /* then find the correct traversal order for the simplex we\92re in. */
+ /* First, six pair-wise comparisons are performed between each possible pair */
+ /* of the four coordinates, and the results are used to add up binary bits */
+ /* for an integer index. */
+ int c1 = (x0 > y0) ? 32 : 0;
+ int c2 = (x0 > z0) ? 16 : 0;
+ int c3 = (y0 > z0) ? 8 : 0;
+ int c4 = (x0 > w0) ? 4 : 0;
+ int c5 = (y0 > w0) ? 2 : 0;
+ int c6 = (z0 > w0) ? 1 : 0;
+ int c = c1 + c2 + c3 + c4 + c5 + c6;
+
+ int i1, j1, k1, l1; /* The integer offsets for the second simplex corner */
+ int i2, j2, k2, l2; /* The integer offsets for the third simplex corner */
+ int i3, j3, k3, l3; /* The integer offsets for the fourth simplex corner */
+
+ float x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3, x4, y4, z4, w4;
+ int ii, jj, kk, ll;
+ float t0, t1, t2, t3, t4;
+
+ /* simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. */
+ /* Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w */
+ /* impossible. Only the 24 indices which have non-zero entries make any sense. */
+ /* We use a thresholding to set the coordinates in turn from the largest magnitude. */
+ /* The number 3 in the "simplex" array is at the position of the largest coordinate. */
+ i1 = simplex[c][0]>=3 ? 1 : 0;
+ j1 = simplex[c][1]>=3 ? 1 : 0;
+ k1 = simplex[c][2]>=3 ? 1 : 0;
+ l1 = simplex[c][3]>=3 ? 1 : 0;
+ /* The number 2 in the "simplex" array is at the second largest coordinate. */
+ i2 = simplex[c][0]>=2 ? 1 : 0;
+ j2 = simplex[c][1]>=2 ? 1 : 0;
+ k2 = simplex[c][2]>=2 ? 1 : 0;
+ l2 = simplex[c][3]>=2 ? 1 : 0;
+ /* The number 1 in the "simplex" array is at the second smallest coordinate. */
+ i3 = simplex[c][0]>=1 ? 1 : 0;
+ j3 = simplex[c][1]>=1 ? 1 : 0;
+ k3 = simplex[c][2]>=1 ? 1 : 0;
+ l3 = simplex[c][3]>=1 ? 1 : 0;
+ /* The fifth corner has all coordinate offsets = 1, so no need to look that up. */
+
+ x1 = x0 - i1 + G4; /* Offsets for second corner in (x,y,z,w) coords */
+ y1 = y0 - j1 + G4;
+ z1 = z0 - k1 + G4;
+ w1 = w0 - l1 + G4;
+ x2 = x0 - i2 + 2.0f*G4; /* Offsets for third corner in (x,y,z,w) coords */
+ y2 = y0 - j2 + 2.0f*G4;
+ z2 = z0 - k2 + 2.0f*G4;
+ w2 = w0 - l2 + 2.0f*G4;
+ x3 = x0 - i3 + 3.0f*G4; /* Offsets for fourth corner in (x,y,z,w) coords */
+ y3 = y0 - j3 + 3.0f*G4;
+ z3 = z0 - k3 + 3.0f*G4;
+ w3 = w0 - l3 + 3.0f*G4;
+ x4 = x0 - 1.0f + 4.0f*G4; /* Offsets for last corner in (x,y,z,w) coords */
+ y4 = y0 - 1.0f + 4.0f*G4;
+ z4 = z0 - 1.0f + 4.0f*G4;
+ w4 = w0 - 1.0f + 4.0f*G4;
+
+ /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */
+ ii = i % 256;
+ jj = j % 256;
+ kk = k % 256;
+ ll = l % 256;
+
+ /* Calculate the contribution from the five corners */
+ t0 = 0.6f - x0*x0 - y0*y0 - z0*z0 - w0*w0;
+ if(t0 < 0.0f) n0 = 0.0f;
+ else {
+ t0 *= t0;
+ n0 = t0 * t0 * grad4(perm[ii+perm[jj+perm[kk+perm[ll]]]], x0, y0, z0, w0);
+ }
+
+ t1 = 0.6f - x1*x1 - y1*y1 - z1*z1 - w1*w1;
+ if(t1 < 0.0f) n1 = 0.0f;
+ else {
+ t1 *= t1;
+ n1 = t1 * t1 * grad4(perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]], x1, y1, z1, w1);
+ }
+
+ t2 = 0.6f - x2*x2 - y2*y2 - z2*z2 - w2*w2;
+ if(t2 < 0.0f) n2 = 0.0f;
+ else {
+ t2 *= t2;
+ n2 = t2 * t2 * grad4(perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]], x2, y2, z2, w2);
+ }
+
+ t3 = 0.6f - x3*x3 - y3*y3 - z3*z3 - w3*w3;
+ if(t3 < 0.0f) n3 = 0.0f;
+ else {
+ t3 *= t3;
+ n3 = t3 * t3 * grad4(perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]], x3, y3, z3, w3);
+ }
+
+ t4 = 0.6f - x4*x4 - y4*y4 - z4*z4 - w4*w4;
+ if(t4 < 0.0f) n4 = 0.0f;
+ else {
+ t4 *= t4;
+ n4 = t4 * t4 * grad4(perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]], x4, y4, z4, w4);
+ }
+
+ /* Sum up and scale the result to cover the range [-1,1] */
+ return 27.0f * (n0 + n1 + n2 + n3 + n4); /* TODO: The scale factor is preliminary! */
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_LIBRARY_NOISE_H\r
-#define SLANG_LIBRARY_NOISE_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-GLfloat _slang_library_noise1 (GLfloat);\r
-GLfloat _slang_library_noise2 (GLfloat, GLfloat);\r
-GLfloat _slang_library_noise3 (GLfloat, GLfloat, GLfloat);\r
-GLfloat _slang_library_noise4 (GLfloat, GLfloat, GLfloat, GLfloat);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_LIBRARY_NOISE_H
+#define SLANG_LIBRARY_NOISE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+GLfloat _slang_library_noise1 (GLfloat);
+GLfloat _slang_library_noise2 (GLfloat, GLfloat);
+GLfloat _slang_library_noise3 (GLfloat, GLfloat, GLfloat);
+GLfloat _slang_library_noise4 (GLfloat, GLfloat, GLfloat, GLfloat);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_library_texsample.c\r
- * built-in library functions for texture and shadow sampling\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "context.h"\r
-#include "colormac.h"\r
-#include "swrast/s_context.h"\r
-#include "slang_library_texsample.h"\r
-\r
-GLvoid _slang_library_tex1d (GLfloat bias, GLfloat s, GLfloat sampler, GLfloat *color)\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLuint unit = (GLuint) sampler;\r
- GLfloat texcoord[4] = { s, 0.0f, 0.0f, 1.0f };\r
- GLfloat lambda = bias;\r
- GLchan rgba[4];\r
-\r
- swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
-GLvoid _slang_library_tex2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat sampler, GLfloat *color)\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLuint unit = (GLuint) sampler;\r
- GLfloat texcoord[4] = { s, t, 0.0f, 1.0f };\r
- GLfloat lambda = bias;\r
- GLchan rgba[4];\r
-\r
- swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
-GLvoid _slang_library_tex3d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
- GLfloat *color)\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLuint unit = (GLuint) sampler;\r
- GLfloat texcoord[4] = { s, t, r, 1.0f };\r
- GLfloat lambda = bias;\r
- GLchan rgba[4];\r
-\r
- swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
-GLvoid _slang_library_texcube (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
- GLfloat *color)\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLuint unit = (GLuint) sampler;\r
- GLfloat texcoord[4] = { s, t, r, 1.0f };\r
- GLfloat lambda = bias;\r
- GLchan rgba[4];\r
-\r
- swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
-GLvoid _slang_library_shad1d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
- GLfloat *color)\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLuint unit = (GLuint) sampler;\r
- GLfloat texcoord[4] = { s, t, r, 1.0f };\r
- GLfloat lambda = bias;\r
- GLchan rgba[4];\r
-\r
- swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
-GLvoid _slang_library_shad2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
- GLfloat *color)\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLuint unit = (GLuint) sampler;\r
- GLfloat texcoord[4] = { s, t, r, 1.0f };\r
- GLfloat lambda = bias;\r
- GLchan rgba[4];\r
-\r
- swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_library_texsample.c
+ * built-in library functions for texture and shadow sampling
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "context.h"
+#include "colormac.h"
+#include "swrast/s_context.h"
+#include "slang_library_texsample.h"
+
+GLvoid _slang_library_tex1d (GLfloat bias, GLfloat s, GLfloat sampler, GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, 0.0f, 0.0f, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_tex2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat sampler, GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, 0.0f, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_tex3d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_texcube (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_shad1d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_shad2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_LIBRARY_TEXSAMPLE_H\r
-#define SLANG_LIBRARY_TEXSAMPLE_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-GLvoid _slang_library_tex1d (GLfloat, GLfloat, GLfloat, GLfloat *);\r
-GLvoid _slang_library_tex2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
-GLvoid _slang_library_tex3d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
-GLvoid _slang_library_texcube (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
-GLvoid _slang_library_shad1d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
-GLvoid _slang_library_shad2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_LIBRARY_TEXSAMPLE_H
+#define SLANG_LIBRARY_TEXSAMPLE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+GLvoid _slang_library_tex1d (GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_tex2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_tex3d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_texcube (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_shad1d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_shad2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.3\r
- *\r
- * Copyright (C) 2005 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-int _mesa_isalnum (char);\r
-int _glslang_3dlabs_InitProcess ();\r
-int _glslang_3dlabs_ShInitialize ();\r
-\r
-#if defined __cplusplus\r
-}\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.3
+ *
+ * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+int _mesa_isalnum (char);
+int _glslang_3dlabs_InitProcess ();
+int _glslang_3dlabs_ShInitialize ();
+
+#if defined __cplusplus
+}
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_preprocess.c\r
- * slang preprocessor\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "grammar_mesa.h"\r
-#include "slang_preprocess.h"\r
-\r
-static const char *slang_version_syn =\r
-#include "library/slang_version_syn.h"\r
-;\r
-\r
-int _slang_preprocess_version (const char *text, unsigned int *version, unsigned int *eaten,\r
- slang_info_log *log)\r
-{\r
- grammar id;\r
- byte *prod, *I;\r
- unsigned int size;\r
-\r
- id = grammar_load_from_text ((const byte *) slang_version_syn);\r
- if (id == 0)\r
- {\r
- char buf[1024];\r
- unsigned int pos;\r
- grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);\r
- slang_info_log_error (log, buf);\r
- return 0;\r
- }\r
-\r
- if (!grammar_fast_check (id, (const byte *) text, &prod, &size, 8))\r
- {\r
- char buf[1024];\r
- unsigned int pos;\r
- grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);\r
- slang_info_log_error (log, buf);\r
- grammar_destroy (id);\r
- return 0;\r
- }\r
-\r
- grammar_destroy (id);\r
-\r
- /* there can be multiple #version directives - grab the last one */\r
- I = prod;\r
- while (I < prod + size)\r
- {\r
- *version =\r
- (unsigned int) I[0] +\r
- (unsigned int) I[1] * 100;\r
- *eaten =\r
- ((unsigned int) I[2]) +\r
- ((unsigned int) I[3] << 8) +\r
- ((unsigned int) I[4] << 16) +\r
- ((unsigned int) I[5] << 24);\r
- I += 6;\r
- }\r
-\r
- grammar_alloc_free (prod);\r
- return 1;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_preprocess.c
+ * slang preprocessor
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "grammar_mesa.h"
+#include "slang_preprocess.h"
+
+static const char *slang_version_syn =
+#include "library/slang_version_syn.h"
+;
+
+int _slang_preprocess_version (const char *text, unsigned int *version, unsigned int *eaten,
+ slang_info_log *log)
+{
+ grammar id;
+ byte *prod, *I;
+ unsigned int size;
+
+ id = grammar_load_from_text ((const byte *) slang_version_syn);
+ if (id == 0)
+ {
+ char buf[1024];
+ unsigned int pos;
+ grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);
+ slang_info_log_error (log, buf);
+ return 0;
+ }
+
+ if (!grammar_fast_check (id, (const byte *) text, &prod, &size, 8))
+ {
+ char buf[1024];
+ unsigned int pos;
+ grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);
+ slang_info_log_error (log, buf);
+ grammar_destroy (id);
+ return 0;
+ }
+
+ grammar_destroy (id);
+
+ /* there can be multiple #version directives - grab the last one */
+ I = prod;
+ while (I < prod + size)
+ {
+ *version =
+ (unsigned int) I[0] +
+ (unsigned int) I[1] * 100;
+ *eaten =
+ ((unsigned int) I[2]) +
+ ((unsigned int) I[3] << 8) +
+ ((unsigned int) I[4] << 16) +
+ ((unsigned int) I[5] << 24);
+ I += 6;
+ }
+
+ grammar_alloc_free (prod);
+ return 1;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_PREPROCESS_H\r
-#define SLANG_PREPROCESS_H\r
-\r
-#include "slang_compile.h"\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-int _slang_preprocess_version (const char *, unsigned int *, unsigned int *, slang_info_log *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_PREPROCESS_H
+#define SLANG_PREPROCESS_H
+
+#include "slang_compile.h"
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+int _slang_preprocess_version (const char *, unsigned int *, unsigned int *, slang_info_log *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
{
arr->type = slang_stor_aggregate;
arr->aggregate = NULL;
- arr->length = 0;\r
+ arr->length = 0;
return GL_TRUE;
}
GLboolean slang_storage_aggregate_construct (slang_storage_aggregate *agg)
{
agg->arrays = NULL;
- agg->count = 0;\r
+ agg->count = 0;
return GL_TRUE;
}
GLvoid slang_storage_aggregate_destruct (slang_storage_aggregate *agg)
{
- GLuint i;\r
+ GLuint i;
for (i = 0; i < agg->count; i++)
slang_storage_array_destruct (agg->arrays + i);
static slang_storage_array *slang_storage_aggregate_push_new (slang_storage_aggregate *agg)
{
- slang_storage_array *arr = NULL;\r
+ slang_storage_array *arr = NULL;
agg->arrays = (slang_storage_array *) slang_alloc_realloc (agg->arrays, agg->count * sizeof (
slang_storage_array), (agg->count + 1) * sizeof (slang_storage_array));
if (agg->arrays != NULL)
{
arr = agg->arrays + agg->count;
- if (!slang_storage_array_construct (arr))\r
+ if (!slang_storage_array_construct (arr))
return NULL;
agg->count++;
}
static GLboolean aggregate_matrix (slang_storage_aggregate *agg, slang_storage_type basic_type,
GLuint dimension)
{
- slang_storage_array *arr = slang_storage_aggregate_push_new (agg);\r
+ slang_storage_array *arr = slang_storage_aggregate_push_new (agg);
if (arr == NULL)
return GL_FALSE;
arr->type = slang_stor_aggregate;
arr->aggregate = (slang_storage_aggregate *) slang_alloc_malloc (sizeof (slang_storage_aggregate));
if (arr->aggregate == NULL)
return GL_FALSE;
- if (!slang_storage_aggregate_construct (arr->aggregate))\r
- {\r
- slang_alloc_free (arr->aggregate);\r
- arr->aggregate = NULL;\r
- return GL_FALSE;\r
+ if (!slang_storage_aggregate_construct (arr->aggregate))
+ {
+ slang_alloc_free (arr->aggregate);
+ arr->aggregate = NULL;
+ return GL_FALSE;
}
if (!aggregate_vector (arr->aggregate, basic_type, dimension))
return GL_FALSE;
}
static GLboolean aggregate_variables (slang_storage_aggregate *agg, slang_variable_scope *vars,
- slang_function_scope *funcs, slang_struct_scope *structs, slang_variable_scope *globals,\r
+ slang_function_scope *funcs, slang_struct_scope *structs, slang_variable_scope *globals,
slang_machine *mach, slang_assembly_file *file, slang_atom_pool *atoms)
{
- GLuint i;\r
+ GLuint i;
for (i = 0; i < vars->num_variables; i++)
if (!_slang_aggregate_variable (agg, &vars->variables[i].type.specifier,
return GL_FALSE;
return GL_TRUE;
}
-\r
-GLboolean _slang_evaluate_int (slang_assembly_file *file, slang_machine *pmach,\r
- slang_assembly_name_space *space, slang_operation *array_size, GLuint *pint,\r
- slang_atom_pool *atoms)\r
-{\r
- slang_assembly_file_restore_point point;\r
- slang_machine mach;\r
- slang_assemble_ctx A;\r
-\r
- A.file = file;\r
- A.mach = pmach;\r
- A.atoms = atoms;\r
- A.space = *space;\r
- A.local.ret_size = 0;\r
- A.local.addr_tmp = 0;\r
- A.local.swizzle_tmp = 4;\r
-\r
- /* save the current assembly */\r
- if (!slang_assembly_file_restore_point_save (file, &point))\r
- return GL_FALSE;\r
-\r
- /* setup the machine */\r
- mach = *pmach;\r
- mach.ip = file->count;\r
-\r
- /* allocate local storage for expression */\r
- if (!slang_assembly_file_push_label (file, slang_asm_local_alloc, 20))\r
- return GL_FALSE;\r
- if (!slang_assembly_file_push_label (file, slang_asm_enter, 20))\r
- return GL_FALSE;\r
-\r
- /* insert the actual expression */\r
- if (!_slang_assemble_operation (&A, array_size, slang_ref_forbid))\r
- return GL_FALSE;\r
- if (!slang_assembly_file_push (file, slang_asm_exit))\r
- return GL_FALSE;\r
-\r
- /* execute the expression */\r
- if (!_slang_execute2 (file, &mach))\r
- return GL_FALSE;\r
-\r
- /* the evaluated expression is on top of the stack */\r
- *pint = (GLuint) mach.mem[mach.sp + SLANG_MACHINE_GLOBAL_SIZE]._float;\r
-\r
- /* restore the old assembly */\r
- if (!slang_assembly_file_restore_point_load (file, &point))\r
- return GL_FALSE;\r
-\r
- return GL_TRUE;\r
-}\r
+
+GLboolean _slang_evaluate_int (slang_assembly_file *file, slang_machine *pmach,
+ slang_assembly_name_space *space, slang_operation *array_size, GLuint *pint,
+ slang_atom_pool *atoms)
+{
+ slang_assembly_file_restore_point point;
+ slang_machine mach;
+ slang_assemble_ctx A;
+
+ A.file = file;
+ A.mach = pmach;
+ A.atoms = atoms;
+ A.space = *space;
+ A.local.ret_size = 0;
+ A.local.addr_tmp = 0;
+ A.local.swizzle_tmp = 4;
+
+ /* save the current assembly */
+ if (!slang_assembly_file_restore_point_save (file, &point))
+ return GL_FALSE;
+
+ /* setup the machine */
+ mach = *pmach;
+ mach.ip = file->count;
+
+ /* allocate local storage for expression */
+ if (!slang_assembly_file_push_label (file, slang_asm_local_alloc, 20))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label (file, slang_asm_enter, 20))
+ return GL_FALSE;
+
+ /* insert the actual expression */
+ if (!_slang_assemble_operation (&A, array_size, slang_ref_forbid))
+ return GL_FALSE;
+ if (!slang_assembly_file_push (file, slang_asm_exit))
+ return GL_FALSE;
+
+ /* execute the expression */
+ if (!_slang_execute2 (file, &mach))
+ return GL_FALSE;
+
+ /* the evaluated expression is on top of the stack */
+ *pint = (GLuint) mach.mem[mach.sp + SLANG_MACHINE_GLOBAL_SIZE]._float;
+
+ /* restore the old assembly */
+ if (!slang_assembly_file_restore_point_load (file, &point))
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
GLboolean _slang_aggregate_variable (slang_storage_aggregate *agg, slang_type_specifier *spec,
GLuint array_len, slang_function_scope *funcs, slang_struct_scope *structs,
- slang_variable_scope *vars, slang_machine *mach, slang_assembly_file *file,\r
+ slang_variable_scope *vars, slang_machine *mach, slang_assembly_file *file,
slang_atom_pool *atoms)
{
switch (spec->type)
case slang_spec_sampler2DShadow:
return aggregate_vector (agg, slang_stor_int, 1);
case slang_spec_struct:
- return aggregate_variables (agg, spec->_struct->fields, funcs, structs, vars, mach,\r
+ return aggregate_variables (agg, spec->_struct->fields, funcs, structs, vars, mach,
file, atoms);
case slang_spec_array:
{
- slang_storage_array *arr;\r
+ slang_storage_array *arr;
arr = slang_storage_aggregate_push_new (agg);
if (arr == NULL)
arr->aggregate = (slang_storage_aggregate *) slang_alloc_malloc (sizeof (slang_storage_aggregate));
if (arr->aggregate == NULL)
return GL_FALSE;
- if (!slang_storage_aggregate_construct (arr->aggregate))\r
- {\r
- slang_alloc_free (arr->aggregate);\r
- arr->aggregate = NULL;\r
- return GL_FALSE;\r
+ if (!slang_storage_aggregate_construct (arr->aggregate))
+ {
+ slang_alloc_free (arr->aggregate);
+ arr->aggregate = NULL;
+ return GL_FALSE;
}
- if (!_slang_aggregate_variable (arr->aggregate, spec->_array, 0, funcs, structs,\r
+ if (!_slang_aggregate_variable (arr->aggregate, spec->_array, 0, funcs, structs,
vars, mach, file, atoms))
- return GL_FALSE;\r
- arr->length = array_len;\r
+ return GL_FALSE;
+ arr->length = array_len;
/* TODO: check if 0 < arr->length <= 65535 */
}
return GL_TRUE;
GLuint _slang_sizeof_aggregate (const slang_storage_aggregate *agg)
{
- GLuint i, size = 0;\r
+ GLuint i, size = 0;
for (i = 0; i < agg->count; i++)
{
- GLuint element_size;\r
+ GLuint element_size;
if (agg->arrays[i].type == slang_stor_aggregate)
element_size = _slang_sizeof_aggregate (agg->arrays[i].aggregate);
GLboolean _slang_flatten_aggregate (slang_storage_aggregate *flat, const slang_storage_aggregate *agg)
{
- GLuint i;\r
+ GLuint i;
for (i = 0; i < agg->count; i++)
{
- GLuint j;\r
+ GLuint j;
for (j = 0; j < agg->arrays[i].length; j++)
{
}
else
{
- slang_storage_array *arr;\r
+ slang_storage_array *arr;
arr = slang_storage_aggregate_push_new (flat);
if (arr == NULL)
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file slang_utility.c\r
- * slang utilities\r
- * \author Michal Krol\r
- */\r
-\r
-#include "imports.h"\r
-#include "slang_utility.h"\r
-\r
-char *slang_string_concat (char *dst, const char *src)\r
-{\r
- return _mesa_strcpy (dst + _mesa_strlen (dst), src);\r
-}\r
-\r
-/* slang_atom_pool */\r
-\r
-void slang_atom_pool_construct (slang_atom_pool *pool)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)\r
- pool->entries[i] = NULL;\r
-}\r
-\r
-void slang_atom_pool_destruct (slang_atom_pool *pool)\r
-{\r
- GLuint i;\r
-\r
- for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)\r
- {\r
- slang_atom_entry *entry;\r
- \r
- entry = pool->entries[i];\r
- while (entry != NULL)\r
- {\r
- slang_atom_entry *next;\r
-\r
- next = entry->next;\r
- slang_alloc_free (entry->id);\r
- slang_alloc_free (entry);\r
- entry = next;\r
- }\r
- }\r
-}\r
-\r
-slang_atom slang_atom_pool_atom (slang_atom_pool *pool, const char *id)\r
-{\r
- GLuint hash;\r
- const char *p = id;\r
- slang_atom_entry **entry;\r
-\r
- hash = 0;\r
- while (*p != '\0')\r
- {\r
- GLuint g;\r
-\r
- hash = (hash << 4) + (GLuint) *p++;\r
- g = hash & 0xf0000000;\r
- if (g != 0)\r
- hash ^= g >> 24;\r
- hash &= ~g;\r
- }\r
- hash %= SLANG_ATOM_POOL_SIZE;\r
-\r
- entry = &pool->entries[hash];\r
- while (*entry != NULL)\r
- {\r
- if (slang_string_compare ((**entry).id, id) == 0)\r
- return (slang_atom) (**entry).id;\r
- entry = &(**entry).next;\r
- }\r
-\r
- *entry = (slang_atom_entry *) slang_alloc_malloc (sizeof (slang_atom_entry));\r
- if (*entry == NULL)\r
- return SLANG_ATOM_NULL;\r
-\r
- (**entry).next = NULL;\r
- (**entry).id = slang_string_duplicate (id);\r
- if ((**entry).id == NULL)\r
- return SLANG_ATOM_NULL;\r
- return (slang_atom) (**entry).id;\r
-}\r
-\r
-const char *slang_atom_pool_id (slang_atom_pool *pool, slang_atom atom)\r
-{\r
- return (const char *) atom;\r
-}\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 slang_utility.c
+ * slang utilities
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_utility.h"
+
+char *slang_string_concat (char *dst, const char *src)
+{
+ return _mesa_strcpy (dst + _mesa_strlen (dst), src);
+}
+
+/* slang_atom_pool */
+
+void slang_atom_pool_construct (slang_atom_pool *pool)
+{
+ GLuint i;
+
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
+ pool->entries[i] = NULL;
+}
+
+void slang_atom_pool_destruct (slang_atom_pool *pool)
+{
+ GLuint i;
+
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
+ {
+ slang_atom_entry *entry;
+
+ entry = pool->entries[i];
+ while (entry != NULL)
+ {
+ slang_atom_entry *next;
+
+ next = entry->next;
+ slang_alloc_free (entry->id);
+ slang_alloc_free (entry);
+ entry = next;
+ }
+ }
+}
+
+slang_atom slang_atom_pool_atom (slang_atom_pool *pool, const char *id)
+{
+ GLuint hash;
+ const char *p = id;
+ slang_atom_entry **entry;
+
+ hash = 0;
+ while (*p != '\0')
+ {
+ GLuint g;
+
+ hash = (hash << 4) + (GLuint) *p++;
+ g = hash & 0xf0000000;
+ if (g != 0)
+ hash ^= g >> 24;
+ hash &= ~g;
+ }
+ hash %= SLANG_ATOM_POOL_SIZE;
+
+ entry = &pool->entries[hash];
+ while (*entry != NULL)
+ {
+ if (slang_string_compare ((**entry).id, id) == 0)
+ return (slang_atom) (**entry).id;
+ entry = &(**entry).next;
+ }
+
+ *entry = (slang_atom_entry *) slang_alloc_malloc (sizeof (slang_atom_entry));
+ if (*entry == NULL)
+ return SLANG_ATOM_NULL;
+
+ (**entry).next = NULL;
+ (**entry).id = slang_string_duplicate (id);
+ if ((**entry).id == NULL)
+ return SLANG_ATOM_NULL;
+ return (slang_atom) (**entry).id;
+}
+
+const char *slang_atom_pool_id (slang_atom_pool *pool, slang_atom atom)
+{
+ return (const char *) atom;
+}
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.5\r
- *\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-#if !defined SLANG_UTILITY_H\r
-#define SLANG_UTILITY_H\r
-\r
-#if defined __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/* Compile-time assertions. If the expression is zero, try to declare an\r
- * array of size [-1] to cause compilation error.\r
- */\r
-#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0)\r
-\r
-#define slang_alloc_free(ptr) _mesa_free (ptr)\r
-#define slang_alloc_malloc(size) _mesa_malloc (size)\r
-#define slang_alloc_realloc(ptr, old_size, size) _mesa_realloc (ptr, old_size, size)\r
-#define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2)\r
-#define slang_string_copy(dst, src) _mesa_strcpy (dst, src)\r
-#define slang_string_duplicate(src) _mesa_strdup (src)\r
-#define slang_string_length(str) _mesa_strlen (str)\r
-\r
-char *slang_string_concat (char *, const char *);\r
-\r
-typedef GLvoid *slang_atom;\r
-\r
-#define SLANG_ATOM_NULL ((slang_atom) 0)\r
-\r
-typedef struct slang_atom_entry_\r
-{\r
- char *id;\r
- struct slang_atom_entry_ *next;\r
-} slang_atom_entry;\r
-\r
-#define SLANG_ATOM_POOL_SIZE 1023\r
-\r
-typedef struct slang_atom_pool_\r
-{\r
- slang_atom_entry *entries[SLANG_ATOM_POOL_SIZE];\r
-} slang_atom_pool;\r
-\r
-GLvoid slang_atom_pool_construct (slang_atom_pool *);\r
-GLvoid slang_atom_pool_destruct (slang_atom_pool *);\r
-slang_atom slang_atom_pool_atom (slang_atom_pool *, const char *);\r
-const char *slang_atom_pool_id (slang_atom_pool *, slang_atom);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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.
+ */
+
+#if !defined SLANG_UTILITY_H
+#define SLANG_UTILITY_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+/* Compile-time assertions. If the expression is zero, try to declare an
+ * array of size [-1] to cause compilation error.
+ */
+#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0)
+
+#define slang_alloc_free(ptr) _mesa_free (ptr)
+#define slang_alloc_malloc(size) _mesa_malloc (size)
+#define slang_alloc_realloc(ptr, old_size, size) _mesa_realloc (ptr, old_size, size)
+#define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2)
+#define slang_string_copy(dst, src) _mesa_strcpy (dst, src)
+#define slang_string_duplicate(src) _mesa_strdup (src)
+#define slang_string_length(str) _mesa_strlen (str)
+
+char *slang_string_concat (char *, const char *);
+
+typedef GLvoid *slang_atom;
+
+#define SLANG_ATOM_NULL ((slang_atom) 0)
+
+typedef struct slang_atom_entry_
+{
+ char *id;
+ struct slang_atom_entry_ *next;
+} slang_atom_entry;
+
+#define SLANG_ATOM_POOL_SIZE 1023
+
+typedef struct slang_atom_pool_
+{
+ slang_atom_entry *entries[SLANG_ATOM_POOL_SIZE];
+} slang_atom_pool;
+
+GLvoid slang_atom_pool_construct (slang_atom_pool *);
+GLvoid slang_atom_pool_destruct (slang_atom_pool *);
+slang_atom slang_atom_pool_atom (slang_atom_pool *, const char *);
+const char *slang_atom_pool_id (slang_atom_pool *, slang_atom);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
-/*\r
- * Mesa 3-D graphics library\r
- * Version: 6.3\r
- *\r
- * Copyright (C) 2005 Brian Paul All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included\r
- * in all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/**\r
- * \file traverse_wrap.h\r
- * Handy TIntermTraverser class wrapper\r
- * \author Michal Krol\r
- */\r
-\r
-#ifndef __TRAVERSE_WRAP_H__\r
-#define __TRAVERSE_WRAP_H__\r
-\r
-#include "Include/intermediate.h"\r
-\r
-/*\r
- The original TIntermTraverser class that is used to walk the intermediate tree,\r
- is not very elegant in its design. One must define static functions with\r
- appropriate prototypes, construct TIntermTraverser object, and set its member\r
- function pointers to one's static functions. If traversal-specific data\r
- is needed, a new class must be derived, and one must up-cast the object\r
- passed as a parameter to the static function.\r
-\r
- The class below eliminates this burden by providing virtual methods that are\r
- to be overridden in the derived class.\r
-*/\r
-\r
-class traverse_wrap: private TIntermTraverser\r
-{\r
-private:\r
- static void _visitSymbol (TIntermSymbol *S, TIntermTraverser *T) {\r
- static_cast<traverse_wrap *> (T)->Symbol (*S);\r
- }\r
- static void _visitConstantUnion (TIntermConstantUnion *U, TIntermTraverser *T) {\r
- static_cast<traverse_wrap *> (T)->ConstantUnion (*U);\r
- }\r
- static bool _visitBinary (bool preVisit, TIntermBinary *B, TIntermTraverser *T) {\r
- return static_cast<traverse_wrap *> (T)->Binary (preVisit, *B);\r
- }\r
- static bool _visitUnary (bool preVisit, TIntermUnary *U, TIntermTraverser *T) {\r
- return static_cast<traverse_wrap *> (T)->Unary (preVisit, *U);\r
- }\r
- static bool _visitSelection (bool preVisit, TIntermSelection *S, TIntermTraverser *T) {\r
- return static_cast<traverse_wrap *> (T)->Selection (preVisit, *S);\r
- }\r
- static bool _visitAggregate (bool preVisit, TIntermAggregate *A, TIntermTraverser *T) {\r
- return static_cast<traverse_wrap *> (T)->Aggregate (preVisit, *A);\r
- }\r
- static bool _visitLoop (bool preVisit, TIntermLoop *L, TIntermTraverser *T) {\r
- return static_cast<traverse_wrap *> (T)->Loop (preVisit, *L);\r
- }\r
- static bool _visitBranch (bool preVisit, TIntermBranch *B, TIntermTraverser *T) {\r
- return static_cast<traverse_wrap *> (T)->Branch (preVisit, *B);\r
- }\r
-public:\r
- traverse_wrap () {\r
- visitSymbol = _visitSymbol;\r
- visitConstantUnion = _visitConstantUnion;\r
- visitBinary = _visitBinary;\r
- visitUnary = _visitUnary;\r
- visitSelection = _visitSelection;\r
- visitAggregate = _visitAggregate;\r
- visitLoop = _visitLoop;\r
- visitBranch = _visitBranch;\r
- }\r
-protected:\r
- virtual void Symbol (const TIntermSymbol &) {\r
- }\r
- virtual void ConstantUnion (const TIntermConstantUnion &) {\r
- }\r
- virtual bool Binary (bool, const TIntermBinary &) {\r
- return true;\r
- }\r
- virtual bool Unary (bool, const TIntermUnary &) {\r
- return true;\r
- }\r
- virtual bool Selection (bool, const TIntermSelection &) {\r
- return true;\r
- }\r
- virtual bool Aggregate (bool, const TIntermAggregate &) {\r
- return true;\r
- }\r
- virtual bool Loop (bool, const TIntermLoop &) {\r
- return true;\r
- }\r
- virtual bool Branch (bool, const TIntermBranch &) {\r
- return true;\r
- }\r
-};\r
-\r
-#endif\r
-\r
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.3
+ *
+ * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ *
+ * 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 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
+ * BRIAN PAUL 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 traverse_wrap.h
+ * Handy TIntermTraverser class wrapper
+ * \author Michal Krol
+ */
+
+#ifndef __TRAVERSE_WRAP_H__
+#define __TRAVERSE_WRAP_H__
+
+#include "Include/intermediate.h"
+
+/*
+ The original TIntermTraverser class that is used to walk the intermediate tree,
+ is not very elegant in its design. One must define static functions with
+ appropriate prototypes, construct TIntermTraverser object, and set its member
+ function pointers to one's static functions. If traversal-specific data
+ is needed, a new class must be derived, and one must up-cast the object
+ passed as a parameter to the static function.
+
+ The class below eliminates this burden by providing virtual methods that are
+ to be overridden in the derived class.
+*/
+
+class traverse_wrap: private TIntermTraverser
+{
+private:
+ static void _visitSymbol (TIntermSymbol *S, TIntermTraverser *T) {
+ static_cast<traverse_wrap *> (T)->Symbol (*S);
+ }
+ static void _visitConstantUnion (TIntermConstantUnion *U, TIntermTraverser *T) {
+ static_cast<traverse_wrap *> (T)->ConstantUnion (*U);
+ }
+ static bool _visitBinary (bool preVisit, TIntermBinary *B, TIntermTraverser *T) {
+ return static_cast<traverse_wrap *> (T)->Binary (preVisit, *B);
+ }
+ static bool _visitUnary (bool preVisit, TIntermUnary *U, TIntermTraverser *T) {
+ return static_cast<traverse_wrap *> (T)->Unary (preVisit, *U);
+ }
+ static bool _visitSelection (bool preVisit, TIntermSelection *S, TIntermTraverser *T) {
+ return static_cast<traverse_wrap *> (T)->Selection (preVisit, *S);
+ }
+ static bool _visitAggregate (bool preVisit, TIntermAggregate *A, TIntermTraverser *T) {
+ return static_cast<traverse_wrap *> (T)->Aggregate (preVisit, *A);
+ }
+ static bool _visitLoop (bool preVisit, TIntermLoop *L, TIntermTraverser *T) {
+ return static_cast<traverse_wrap *> (T)->Loop (preVisit, *L);
+ }
+ static bool _visitBranch (bool preVisit, TIntermBranch *B, TIntermTraverser *T) {
+ return static_cast<traverse_wrap *> (T)->Branch (preVisit, *B);
+ }
+public:
+ traverse_wrap () {
+ visitSymbol = _visitSymbol;
+ visitConstantUnion = _visitConstantUnion;
+ visitBinary = _visitBinary;
+ visitUnary = _visitUnary;
+ visitSelection = _visitSelection;
+ visitAggregate = _visitAggregate;
+ visitLoop = _visitLoop;
+ visitBranch = _visitBranch;
+ }
+protected:
+ virtual void Symbol (const TIntermSymbol &) {
+ }
+ virtual void ConstantUnion (const TIntermConstantUnion &) {
+ }
+ virtual bool Binary (bool, const TIntermBinary &) {
+ return true;
+ }
+ virtual bool Unary (bool, const TIntermUnary &) {
+ return true;
+ }
+ virtual bool Selection (bool, const TIntermSelection &) {
+ return true;
+ }
+ virtual bool Aggregate (bool, const TIntermAggregate &) {
+ return true;
+ }
+ virtual bool Loop (bool, const TIntermLoop &) {
+ return true;
+ }
+ virtual bool Branch (bool, const TIntermBranch &) {
+ return true;
+ }
+};
+
+#endif
+