summaryrefslogtreecommitdiffstats
path: root/src/opengl/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/util')
-rw-r--r--src/opengl/util/README-GLSL18
-rw-r--r--src/opengl/util/brush_painter.glsl7
-rw-r--r--src/opengl/util/brushes.conf6
-rw-r--r--src/opengl/util/composition_mode_colorburn.glsl13
-rw-r--r--src/opengl/util/composition_mode_colordodge.glsl15
-rw-r--r--src/opengl/util/composition_mode_darken.glsl9
-rw-r--r--src/opengl/util/composition_mode_difference.glsl9
-rw-r--r--src/opengl/util/composition_mode_exclusion.glsl9
-rw-r--r--src/opengl/util/composition_mode_hardlight.glsl14
-rw-r--r--src/opengl/util/composition_mode_lighten.glsl9
-rw-r--r--src/opengl/util/composition_mode_multiply.glsl9
-rw-r--r--src/opengl/util/composition_mode_overlay.glsl13
-rw-r--r--src/opengl/util/composition_mode_screen.glsl6
-rw-r--r--src/opengl/util/composition_mode_softlight.glsl18
-rw-r--r--src/opengl/util/composition_modes.conf12
-rw-r--r--src/opengl/util/conical_brush.glsl27
-rw-r--r--src/opengl/util/ellipse.glsl6
-rw-r--r--src/opengl/util/ellipse_aa.glsl6
-rw-r--r--src/opengl/util/ellipse_aa_copy.glsl11
-rw-r--r--src/opengl/util/ellipse_aa_radial.glsl24
-rw-r--r--src/opengl/util/ellipse_functions.glsl63
-rw-r--r--src/opengl/util/fast_painter.glsl19
-rw-r--r--src/opengl/util/fragmentprograms_p.h7372
-rw-r--r--src/opengl/util/generator.cpp435
-rw-r--r--src/opengl/util/generator.pro11
-rwxr-xr-xsrc/opengl/util/glsl_to_include.sh33
-rw-r--r--src/opengl/util/linear_brush.glsl22
-rw-r--r--src/opengl/util/masks.conf3
-rw-r--r--src/opengl/util/painter.glsl21
-rw-r--r--src/opengl/util/painter_nomask.glsl9
-rw-r--r--src/opengl/util/pattern_brush.glsl25
-rw-r--r--src/opengl/util/radial_brush.glsl28
-rw-r--r--src/opengl/util/simple_porter_duff.glsl16
-rw-r--r--src/opengl/util/solid_brush.glsl4
-rw-r--r--src/opengl/util/texture_brush.glsl23
-rw-r--r--src/opengl/util/trap_exact_aa.glsl58
36 files changed, 8383 insertions, 0 deletions
diff --git a/src/opengl/util/README-GLSL b/src/opengl/util/README-GLSL
new file mode 100644
index 0000000..ff20eb4
--- /dev/null
+++ b/src/opengl/util/README-GLSL
@@ -0,0 +1,18 @@
+Use of GLSL for vertex and fragment programs in Qt
+---------------------------------------------------
+
+We don't compile the *.glsl files because we don't want the build process of
+Qt to require cgc from nVidia to build the fragment programs.
+
+The script src/opengl/util/glsl_to_include.sh will compile a GLSL program to a file
+that can be included in a C(++) program. The file is the output from cgc
+quoted as a string.
+
+This can be done manually by:
+
+./glsl_to_include.sh radial.glsl
+./glsl_to_include.sh conical.glsl
+
+This will produce the files radial.frag and radial.glsl_quoted.
+(and also conical.frag and conical.glsl_quoted)
+These files are included by qpaintengine_opengl.cpp
diff --git a/src/opengl/util/brush_painter.glsl b/src/opengl/util/brush_painter.glsl
new file mode 100644
index 0000000..6c4acdf
--- /dev/null
+++ b/src/opengl/util/brush_painter.glsl
@@ -0,0 +1,7 @@
+// fast brush painter for composition modes which can be implemented with blendfuncs
+// no mask, used for fast filling of aliased primitives (or multisampled)
+
+void main()
+{
+ gl_FragColor = brush();
+}
diff --git a/src/opengl/util/brushes.conf b/src/opengl/util/brushes.conf
new file mode 100644
index 0000000..93e2b3b
--- /dev/null
+++ b/src/opengl/util/brushes.conf
@@ -0,0 +1,6 @@
+FRAGMENT_PROGRAM_BRUSH_SOLID solid_brush.glsl
+FRAGMENT_PROGRAM_BRUSH_RADIAL radial_brush.glsl
+FRAGMENT_PROGRAM_BRUSH_CONICAL conical_brush.glsl
+FRAGMENT_PROGRAM_BRUSH_LINEAR linear_brush.glsl
+FRAGMENT_PROGRAM_BRUSH_TEXTURE texture_brush.glsl
+FRAGMENT_PROGRAM_BRUSH_PATTERN pattern_brush.glsl
diff --git a/src/opengl/util/composition_mode_colorburn.glsl b/src/opengl/util/composition_mode_colorburn.glsl
new file mode 100644
index 0000000..a5a153f
--- /dev/null
+++ b/src/opengl/util/composition_mode_colorburn.glsl
@@ -0,0 +1,13 @@
+// Dca' = Sca.Da + Dca.Sa <= Sa.Da ?
+// Sca.(1 - Da) + Dca.(1 - Sa)
+// Sa.(Sca.Da + Dca.Sa - Sa.Da)/Sca + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = mix(src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
+ src.a * (src.rgb * dst.a + dst.rgb * src.a - src.a * dst.a) / max(src.rgb, 0.00001) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
+ step(src.a * dst.a, src.rgb * dst.a + dst.rgb * src.a));
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_colordodge.glsl b/src/opengl/util/composition_mode_colordodge.glsl
new file mode 100644
index 0000000..c194441
--- /dev/null
+++ b/src/opengl/util/composition_mode_colordodge.glsl
@@ -0,0 +1,15 @@
+// Dca' = Sca.Da + Dca.Sa <= Sa.Da ?
+// Dca.Sa/(1 - Sca/Sa) + Sca.(1 - Da) + Dca.(1 - Sa) :
+// Sa.Da + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ vec3 temp = src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.rgb = mix(dst.rgb * src.a / max(1 - src.rgb / max(src.a, 0.000001), 0.000001) + temp,
+ src.a * dst.a + temp,
+ step(src.a * dst.a, src.rgb * dst.a + dst.rgb * src.a));
+
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_darken.glsl b/src/opengl/util/composition_mode_darken.glsl
new file mode 100644
index 0000000..c1e83fd
--- /dev/null
+++ b/src/opengl/util/composition_mode_darken.glsl
@@ -0,0 +1,9 @@
+// Dca' = min(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = min(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_difference.glsl b/src/opengl/util/composition_mode_difference.glsl
new file mode 100644
index 0000000..ca13ce7
--- /dev/null
+++ b/src/opengl/util/composition_mode_difference.glsl
@@ -0,0 +1,9 @@
+// Dca' = Sca + Dca - 2.min(Sca.Da, Dca.Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = src.rgb + dst.rgb - 2 * min(src.rgb * dst.a, dst.rgb * src.a);
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_exclusion.glsl b/src/opengl/util/composition_mode_exclusion.glsl
new file mode 100644
index 0000000..ccd1183
--- /dev/null
+++ b/src/opengl/util/composition_mode_exclusion.glsl
@@ -0,0 +1,9 @@
+// Dca' = (Sca.Da + Dca.Sa - 2.Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = (src.rgb * dst.a + dst.rgb * src.a - 2 * src.rgb * dst.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_hardlight.glsl b/src/opengl/util/composition_mode_hardlight.glsl
new file mode 100644
index 0000000..9dd4de3
--- /dev/null
+++ b/src/opengl/util/composition_mode_hardlight.glsl
@@ -0,0 +1,14 @@
+// Dca' = 2.Sca < Sa ?
+// 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa) :
+// Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = mix(2 * src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
+ src.a * dst.a - 2 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
+ step(src.a, 2 * src.rgb));
+ result.a = src.a + dst.a - src.a * dst.a;
+
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_lighten.glsl b/src/opengl/util/composition_mode_lighten.glsl
new file mode 100644
index 0000000..1fbd27a
--- /dev/null
+++ b/src/opengl/util/composition_mode_lighten.glsl
@@ -0,0 +1,9 @@
+// Dca' = max(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = max(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_multiply.glsl b/src/opengl/util/composition_mode_multiply.glsl
new file mode 100644
index 0000000..268345a
--- /dev/null
+++ b/src/opengl/util/composition_mode_multiply.glsl
@@ -0,0 +1,9 @@
+// Dca' = Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_overlay.glsl b/src/opengl/util/composition_mode_overlay.glsl
new file mode 100644
index 0000000..a9b7226
--- /dev/null
+++ b/src/opengl/util/composition_mode_overlay.glsl
@@ -0,0 +1,13 @@
+// Dca' = 2.Dca < Da ?
+// 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
+// Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ result.rgb = mix(2 * src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
+ src.a * dst.a - 2 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a),
+ step(dst.a, 2 * dst.rgb));
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_mode_screen.glsl b/src/opengl/util/composition_mode_screen.glsl
new file mode 100644
index 0000000..8f4f010
--- /dev/null
+++ b/src/opengl/util/composition_mode_screen.glsl
@@ -0,0 +1,6 @@
+// Dca' = Sca + Dca - Sca.Dca
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ return src + dst - src * dst;
+}
diff --git a/src/opengl/util/composition_mode_softlight.glsl b/src/opengl/util/composition_mode_softlight.glsl
new file mode 100644
index 0000000..0237827
--- /dev/null
+++ b/src/opengl/util/composition_mode_softlight.glsl
@@ -0,0 +1,18 @@
+// Dca' = 2.Sca < Sa ?
+// Dca.(Sa - (1 - Dca/Da).(2.Sca - Sa)) + Sca.(1 - Da) + Dca.(1 - Sa) :
+// (8.Dca <= Da ?
+// Dca.(Sa - (1 - Dca/Da).(2.Sca - Sa).(3 - 8.Dca/Da)) + Sca.(1 - Da) + Dca.(1 - Sa) :
+// (Dca.Sa + ((Dca/Da)^(0.5).Da - Dca).(2.Sca - Sa)) + Sca.(1 - Da) + Dca.(1 - Sa))
+// Da' = Sa + Da - Sa.Da
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+ float da = max(dst.a, 0.00001);
+ result.rgb = mix(dst.rgb * (src.a - (1 - dst.rgb / da) * (2 * src.rgb - src.a)),
+ mix(dst.rgb * (src.a - (1 - dst.rgb / da) * (2 * src.rgb - src.a) * (3 - 8 * dst.rgb / da)),
+ (dst.rgb * src.a + (sqrt(dst.rgb / da) * dst.a - dst.rgb) * (2 * src.rgb - src.a)),
+ step(dst.a, 8 * dst.rgb)),
+ step(src.a, 2 * src.rgb)) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a);
+ result.a = src.a + dst.a - src.a * dst.a;
+ return result;
+}
diff --git a/src/opengl/util/composition_modes.conf b/src/opengl/util/composition_modes.conf
new file mode 100644
index 0000000..df52830
--- /dev/null
+++ b/src/opengl/util/composition_modes.conf
@@ -0,0 +1,12 @@
+COMPOSITION_MODES_SIMPLE_PORTER_DUFF simple_porter_duff.glsl
+COMPOSITION_MODES_MULTIPLY composition_mode_multiply.glsl
+COMPOSITION_MODES_SCREEN composition_mode_screen.glsl
+COMPOSITION_MODES_OVERLAY composition_mode_overlay.glsl
+COMPOSITION_MODES_DARKEN composition_mode_darken.glsl
+COMPOSITION_MODES_LIGHTEN composition_mode_lighten.glsl
+COMPOSITION_MODES_COLORDODGE composition_mode_colordodge.glsl
+COMPOSITION_MODES_COLORBURN composition_mode_colorburn.glsl
+COMPOSITION_MODES_HARDLIGHT composition_mode_hardlight.glsl
+COMPOSITION_MODES_SOFTLIGHT composition_mode_softlight.glsl
+COMPOSITION_MODES_DIFFERENCE composition_mode_difference.glsl
+COMPOSITION_MODES_EXCLUSION composition_mode_exclusion.glsl
diff --git a/src/opengl/util/conical_brush.glsl b/src/opengl/util/conical_brush.glsl
new file mode 100644
index 0000000..83ee2f5
--- /dev/null
+++ b/src/opengl/util/conical_brush.glsl
@@ -0,0 +1,27 @@
+// conical gradient shader
+#define M_PI 3.14159265358979323846
+uniform sampler1D palette;
+uniform float angle;
+uniform vec3 inv_matrix_m0;
+uniform vec3 inv_matrix_m1;
+uniform vec3 inv_matrix_m2;
+
+vec4 brush()
+{
+ mat3 mat;
+
+ mat[0] = inv_matrix_m0;
+ mat[1] = inv_matrix_m1;
+ mat[2] = inv_matrix_m2;
+
+ vec3 hcoords = mat * vec3(gl_FragCoord.xy, 1);
+ vec2 A = hcoords.xy / hcoords.z;
+
+/* float val = fmod((atan2(-A.y, A.x) + angle) / (2.0 * M_PI), 1); */
+ if (abs(A.y) == abs(A.x))
+ A.y += 0.002;
+ float t = (atan2(-A.y, A.x) + angle) / (2.0 * M_PI);
+ float val = t - floor(t);
+ return texture1D(palette, val);
+}
+
diff --git a/src/opengl/util/ellipse.glsl b/src/opengl/util/ellipse.glsl
new file mode 100644
index 0000000..860ae77
--- /dev/null
+++ b/src/opengl/util/ellipse.glsl
@@ -0,0 +1,6 @@
+#include "ellipse_functions.glsl"
+
+void main()
+{
+ gl_FragColor = ellipse();
+}
diff --git a/src/opengl/util/ellipse_aa.glsl b/src/opengl/util/ellipse_aa.glsl
new file mode 100644
index 0000000..f7a6454
--- /dev/null
+++ b/src/opengl/util/ellipse_aa.glsl
@@ -0,0 +1,6 @@
+#include "ellipse_functions.glsl"
+
+void main()
+{
+ gl_FragColor = ellipse_aa();
+}
diff --git a/src/opengl/util/ellipse_aa_copy.glsl b/src/opengl/util/ellipse_aa_copy.glsl
new file mode 100644
index 0000000..5372f58
--- /dev/null
+++ b/src/opengl/util/ellipse_aa_copy.glsl
@@ -0,0 +1,11 @@
+uniform vec2 r; // r_x and r_y
+
+uniform sampler2D texture;
+uniform vec2 inv_texture_size;
+
+#include "ellipse_functions.glsl"
+
+void main()
+{
+ gl_FragColor = ellipse_aa() * texture2D(texture, gl_FragCoord.xy * inv_texture_size);
+}
diff --git a/src/opengl/util/ellipse_aa_radial.glsl b/src/opengl/util/ellipse_aa_radial.glsl
new file mode 100644
index 0000000..0878f99
--- /dev/null
+++ b/src/opengl/util/ellipse_aa_radial.glsl
@@ -0,0 +1,24 @@
+#include "ellipse_functions.glsl"
+
+uniform sampler1D palette;
+uniform vec2 fmp;
+uniform float fmp2_m_radius2;
+uniform vec4 inv_matrix;
+uniform vec2 inv_matrix_offset;
+
+void main()
+{
+ // float2 A = frag_coord.xy;//mul(inv_matrix, frag_coord.xy) + inv_matrix_offset;
+ mat2 mat;
+ mat[0][0] = inv_matrix.x;
+ mat[0][1] = inv_matrix.y;
+ mat[1][0] = inv_matrix.z;
+ mat[1][1] = inv_matrix.w;
+ vec2 A = gl_FragCoord.xy * mat + inv_matrix_offset;
+ vec2 B = fmp;
+ float a = fmp2_m_radius2;
+ float b = 2.0*dot(A, B);
+ float c = -dot(A, A);
+ float val = (-b + sqrt(b*b - 4.0*a*c)) / (2.0*a);
+ gl_FragColor = texture1D(palette, val) * ellipse_aa();
+}
diff --git a/src/opengl/util/ellipse_functions.glsl b/src/opengl/util/ellipse_functions.glsl
new file mode 100644
index 0000000..eed18e8
--- /dev/null
+++ b/src/opengl/util/ellipse_functions.glsl
@@ -0,0 +1,63 @@
+uniform vec3 inv_matrix_m0;
+uniform vec3 inv_matrix_m1;
+uniform vec3 inv_matrix_m2;
+
+uniform vec2 ellipse_offset;
+
+float ellipse()
+{
+ vec2 st = gl_TexCoord[0].st;
+
+ if (dot(st, st) > 1)
+ discard;
+
+ return 1.0;
+}
+
+// ellipse equation
+
+// s^2/a^2 + t^2/b^2 = 1
+//
+// implicit equation:
+// g(s,t) = 1 - s^2/r_s^2 - t^2/r_t^2
+
+// distance from ellipse:
+// grad = [dg/dx dg/dy]
+// d(s, t) ~= g(s, t) / |grad|
+
+// dg/dx = dg/ds * ds/dx + dg/dt * dt/dx
+// dg/dy = dg/ds * ds/dy + dg/dt * dt/dy
+
+float ellipse_aa()
+{
+ mat3 mat;
+
+ mat[0] = inv_matrix_m0;
+ mat[1] = inv_matrix_m1;
+ mat[2] = inv_matrix_m2;
+
+ vec3 hcoords = mat * vec3(gl_FragCoord.xy + ellipse_offset, 1);
+ float inv_w = 1.0 / hcoords.z;
+ vec2 st = hcoords.xy * inv_w;
+
+ vec4 xy = vec4(mat[0].xy, mat[1].xy);
+ vec2 h = vec2(mat[0].z, mat[1].z);
+
+ vec4 dstdxy = (xy.xzyw - h.xyxy * st.xxyy) * inv_w;
+
+ //dstdxy.x = (mat[0].x - mat[0].z * st.x) * inv_w; // ds/dx
+ //dstdxy.y = (mat[1].x - mat[1].z * st.x) * inv_w; // ds/dy
+ //dstdxy.z = (mat[0].y - mat[0].z * st.y) * inv_w; // dt/dx
+ //dstdxy.w = (mat[1].y - mat[1].z * st.y) * inv_w; // dt/dy
+
+ vec2 inv_r = gl_TexCoord[0].xy;
+ vec2 n = st * inv_r;
+ float g = 1.0 - dot(n, n);
+
+ vec2 dgdst = -2.0 * n * inv_r;
+
+ vec2 grad = vec2(dot(dgdst, dstdxy.xz),
+ dot(dgdst, dstdxy.yw));
+
+ return smoothstep(-0.5, 0.5, g * inversesqrt(dot(grad, grad)));
+}
diff --git a/src/opengl/util/fast_painter.glsl b/src/opengl/util/fast_painter.glsl
new file mode 100644
index 0000000..63f5e5f
--- /dev/null
+++ b/src/opengl/util/fast_painter.glsl
@@ -0,0 +1,19 @@
+// fast painter for composition modes which can be implemented with blendfuncs
+
+uniform sampler2D mask_texture;
+uniform vec2 inv_mask_size;
+uniform vec2 mask_offset;
+uniform vec4 mask_channel;
+
+float mask()
+{
+ return dot(mask_channel, texture2D(mask_texture, (gl_FragCoord.xy + mask_offset) * inv_mask_size));
+}
+
+void main()
+{
+ // combine clip and coverage channels
+ float mask_alpha = mask();
+
+ gl_FragColor = brush() * mask_alpha;
+}
diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h
new file mode 100644
index 0000000..ecf0bf8
--- /dev/null
+++ b/src/opengl/util/fragmentprograms_p.h
@@ -0,0 +1,7372 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtOpenGL module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef FRAGMENTPROGRAMS_H
+#define FRAGMENTPROGRAMS_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+enum FragmentVariable {
+ VAR_BRUSH_TEXTURE,
+ VAR_LINEAR,
+ VAR_INV_MATRIX_M1,
+ VAR_INV_MASK_SIZE,
+ VAR_INV_MATRIX_M2,
+ VAR_PORTERDUFF_AB,
+ VAR_MASK_CHANNEL,
+ VAR_ELLIPSE_OFFSET,
+ VAR_PORTERDUFF_XYZ,
+ VAR_INV_DST_SIZE,
+ VAR_MASK_TEXTURE,
+ VAR_DST_TEXTURE,
+ VAR_PALETTE,
+ VAR_MASK_OFFSET,
+ VAR_INV_BRUSH_TEXTURE_SIZE,
+ VAR_FMP2_M_RADIUS2,
+ VAR_FMP,
+ VAR_INV_MATRIX_M0,
+ VAR_ANGLE,
+};
+
+enum FragmentBrushType {
+ FRAGMENT_PROGRAM_BRUSH_SOLID,
+ FRAGMENT_PROGRAM_BRUSH_RADIAL,
+ FRAGMENT_PROGRAM_BRUSH_CONICAL,
+ FRAGMENT_PROGRAM_BRUSH_LINEAR,
+ FRAGMENT_PROGRAM_BRUSH_TEXTURE,
+ FRAGMENT_PROGRAM_BRUSH_PATTERN,
+};
+
+enum FragmentCompositionModeType {
+ COMPOSITION_MODES_SIMPLE_PORTER_DUFF,
+ COMPOSITION_MODES_MULTIPLY,
+ COMPOSITION_MODES_SCREEN,
+ COMPOSITION_MODES_OVERLAY,
+ COMPOSITION_MODES_DARKEN,
+ COMPOSITION_MODES_LIGHTEN,
+ COMPOSITION_MODES_COLORDODGE,
+ COMPOSITION_MODES_COLORBURN,
+ COMPOSITION_MODES_HARDLIGHT,
+ COMPOSITION_MODES_SOFTLIGHT,
+ COMPOSITION_MODES_DIFFERENCE,
+ COMPOSITION_MODES_EXCLUSION,
+ COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK,
+ COMPOSITION_MODES_MULTIPLY_NOMASK,
+ COMPOSITION_MODES_SCREEN_NOMASK,
+ COMPOSITION_MODES_OVERLAY_NOMASK,
+ COMPOSITION_MODES_DARKEN_NOMASK,
+ COMPOSITION_MODES_LIGHTEN_NOMASK,
+ COMPOSITION_MODES_COLORDODGE_NOMASK,
+ COMPOSITION_MODES_COLORBURN_NOMASK,
+ COMPOSITION_MODES_HARDLIGHT_NOMASK,
+ COMPOSITION_MODES_SOFTLIGHT_NOMASK,
+ COMPOSITION_MODES_DIFFERENCE_NOMASK,
+ COMPOSITION_MODES_EXCLUSION_NOMASK,
+ COMPOSITION_MODE_BLEND_MODE_MASK,
+ COMPOSITION_MODE_BLEND_MODE_NOMASK,
+};
+
+enum FragmentMaskType {
+ FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA,
+ FRAGMENT_PROGRAM_MASK_ELLIPSE_AA,
+};
+
+static const unsigned int num_fragment_variables = 19;
+
+static const unsigned int num_fragment_brushes = 6;
+static const unsigned int num_fragment_composition_modes = 26;
+static const unsigned int num_fragment_masks = 2;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA =
+ "!!ARBfp1.0\n"
+ "PARAM c[1] = { { 0.5, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "ADD R4.x, fragment.position, c[0];\n"
+ "ADD R0.y, fragment.position, -c[0].x;\n"
+ "MAX R2.x, R0.y, fragment.texcoord[0].y;\n"
+ "ADD R0.x, fragment.position.y, c[0];\n"
+ "MIN R2.y, R0.x, fragment.texcoord[0].x;\n"
+ "ADD R3.x, fragment.position, -c[0];\n"
+ "ADD R1.zw, -fragment.texcoord[0], -fragment.texcoord[0];\n"
+ "MOV R3.y, R4.x;\n"
+ "MOV R0.yw, R2.x;\n"
+ "MOV R0.xz, R2.y;\n"
+ "MAD R0, fragment.texcoord[1].xxzz, R0, fragment.texcoord[1].yyww;\n"
+ "MAD R1.xy, fragment.position.x, c[0].y, -R0.zwzw;\n"
+ "MOV R0.w, R1.x;\n"
+ "MOV R1.x, R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "SGE R2.zw, R1.xyxy, R0;\n"
+ "MAX R0.xy, R0.zwzw, R1;\n"
+ "MIN R0.zw, R0, R1.xyxy;\n"
+ "MAD R2.zw, R2, R1, fragment.texcoord[0];\n"
+ "ADD R1, R3.xyxy, -R0.zzww;\n"
+ "MAD R1, R1, R2.zzww, R2.x;\n"
+ "ADD R3.zw, R0.xyxy, R0;\n"
+ "ADD R3.y, R2, -R2.x;\n"
+ "ADD R2.zw, R1.xyyw, -R2.x;\n"
+ "ADD R4.zw, R4.x, -R0;\n"
+ "MUL R2.zw, R4, R2;\n"
+ "ADD R4.zw, R1.xyyw, R1.xyxz;\n"
+ "ADD R1.xz, R2.y, -R1;\n"
+ "MAD R2.zw, -R2, c[0].x, R3.y;\n"
+ "MAD R3.zw, R3, c[0].x, -R3.x;\n"
+ "MAD R3.zw, R3, R3.y, -R2;\n"
+ "ADD R1.y, R4.x, -R3.x;\n"
+ "MAD R4.zw, -R4, c[0].x, R2.y;\n"
+ "MUL R4.zw, R4, R1.y;\n"
+ "ADD R1.yw, R0.xxzy, -R3.x;\n"
+ "MUL R1.xy, R1.xzzw, R1.ywzw;\n"
+ "MAD R1.zw, R1.xyxy, c[0].x, -R4;\n"
+ "SGE R1.xy, R4.x, R0;\n"
+ "MUL R1.zw, R1.xyxy, R1;\n"
+ "MAD R1.xy, R1, R3.zwzw, R2.zwzw;\n"
+ "SGE R2.zw, R3.x, R0;\n"
+ "ADD R1.zw, R4, R1;\n"
+ "ADD R1.zw, R1, -R1.xyxy;\n"
+ "MAD R1.xy, R2.zwzw, R1.zwzw, R1;\n"
+ "ADD R1.xy, R1, -R3.y;\n"
+ "SGE R0.zw, R4.x, R0;\n"
+ "MAD R0.zw, R0, R1.xyxy, R3.y;\n"
+ "SGE R0.xy, R0, R3.x;\n"
+ "MUL R0.xy, R0.zwzw, R0;\n"
+ "ADD R0.x, R3.y, -R0;\n"
+ "SGE R0.z, R2.y, R2.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "MUL result.color, R0.x, R0.z;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_ELLIPSE_AA =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..3],\n"
+ " { -2, 1, -0.5, 2 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R1.xyz, R0.y, c[2];\n"
+ "MAD R0.xyz, R0.x, c[1], R1;\n"
+ "ADD R0.xyz, R0, c[3];\n"
+ "RCP R2.z, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R2.z;\n"
+ "MUL R2.xy, R0.zwzw, fragment.texcoord[0];\n"
+ "MOV R1.xy, c[1];\n"
+ "MOV R1.zw, c[2].xyxy;\n"
+ "MOV R0.x, c[1].z;\n"
+ "MOV R0.y, c[2].z;\n"
+ "MAD R0, -R0.xyxy, R0.zzww, R1.xzyw;\n"
+ "MUL R1.xy, R2, fragment.texcoord[0];\n"
+ "MUL R0, R0, R2.z;\n"
+ "MUL R1.xy, R1, c[4].x;\n"
+ "MUL R1.zw, R1.xyxy, R0.xyxz;\n"
+ "MUL R0.xy, R1, R0.ywzw;\n"
+ "ADD R0.w, R0.x, R0.y;\n"
+ "MUL R0.xy, R2, R2;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "ADD R0.z, R1, R1.w;\n"
+ "MUL R0.zw, R0, R0;\n"
+ "ADD R0.y, R0.z, R0.w;\n"
+ "RSQ R0.y, R0.y;\n"
+ "ADD R0.x, -R0, c[4].y;\n"
+ "MAD_SAT R0.x, R0.y, R0, -c[4].z;\n"
+ "MUL R0.y, -R0.x, c[4].w;\n"
+ "ADD R0.y, R0, c[5].x;\n"
+ "MUL R0.x, R0, R0;\n"
+ "MUL result.color, R0.x, R0.y;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 1 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MUL R0.xyz, R1, c[6].y;\n"
+ "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R0.xyz, fragment.color.primary, c[6].x;\n"
+ "MAD R2.xyz, R0, R1.w, R2;\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "ADD R0.w, -R1, c[4].x;\n"
+ "MUL R0.xyz, fragment.color.primary, c[5].y;\n"
+ "MAD R2.xyz, R0, R0.w, R2;\n"
+ "MUL R0.xyz, R1, c[5].z;\n"
+ "ADD R0.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R0, R0.w, R2;\n"
+ "ADD R0.y, -R1.w, c[4].x;\n"
+ "MUL R0.x, fragment.color.primary.w, R1.w;\n"
+ "MUL R0.y, fragment.color.primary.w, R0;\n"
+ "MUL R0.z, R1.w, R0.w;\n"
+ "DP3 R2.w, R0, c[5];\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_MULTIPLY =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "ADD R0.x, -R1.w, c[4];\n"
+ "MUL R0.xyz, fragment.color.primary, R0.x;\n"
+ "MAD R0.xyz, fragment.color.primary, R1, R0;\n"
+ "ADD R0.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R1, R0.w, R0;\n"
+ "ADD R0.z, fragment.color.primary.w, R1.w;\n"
+ "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SCREEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[4] = { program.local[0..3] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "ADD R2, fragment.color.primary, R1;\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "MAD R2, -fragment.color.primary, R1, R2;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_OVERLAY =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "ADD R0.w, -R1, c[4].y;\n"
+ "MUL R3.xyz, fragment.color.primary, R0.w;\n"
+ "ADD R2.xyz, fragment.color.primary.w, -fragment.color.primary;\n"
+ "ADD R0.xyz, R1.w, -R1;\n"
+ "MUL R0.xyz, R0, R2;\n"
+ "MUL R0.xyz, R0, c[4].x;\n"
+ "MAD R0.xyz, fragment.color.primary.w, R1.w, -R0;\n"
+ "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
+ "MUL R2.xyz, fragment.color.primary, R1;\n"
+ "MAD R2.xyz, R2, c[4].x, R3;\n"
+ "ADD R0.w, -fragment.color.primary, c[4].y;\n"
+ "MAD R3.xyz, R1, R0.w, R0;\n"
+ "MAD R2.xyz, R1, R0.w, R2;\n"
+ "MUL R0.xyz, R1, c[4].x;\n"
+ "SGE R0.xyz, R0, R1.w;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "MAD R2.xyz, R0, R3, R2;\n"
+ "ADD R0.z, fragment.color.primary.w, R1.w;\n"
+ "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DARKEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, fragment.color.primary.w;\n"
+ "MUL R0.xyz, fragment.color.primary, R1.w;\n"
+ "MIN R0.xyz, R0, R2;\n"
+ "ADD R0.w, -R1, c[4].x;\n"
+ "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
+ "ADD R0.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R1, R0.w, R0;\n"
+ "ADD R0.z, fragment.color.primary.w, R1.w;\n"
+ "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_LIGHTEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, fragment.color.primary.w;\n"
+ "MUL R0.xyz, fragment.color.primary, R1.w;\n"
+ "MAX R0.xyz, R0, R2;\n"
+ "ADD R0.w, -R1, c[4].x;\n"
+ "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
+ "ADD R0.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R1, R0.w, R0;\n"
+ "ADD R0.z, fragment.color.primary.w, R1.w;\n"
+ "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORDODGE =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.y, -fragment.color.primary.w, c[4].x;\n"
+ "MAX R1.x, fragment.color.primary.w, c[4].y;\n"
+ "MUL R2.xyz, R0, R1.y;\n"
+ "ADD R1.w, -R0, c[4].x;\n"
+ "MAD R3.xyz, fragment.color.primary, R1.w, R2;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R1.xyz, -fragment.color.primary, R1.x, c[4].x;\n"
+ "MAX R1.xyz, R1, c[4].y;\n"
+ "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.w, fragment.color.primary, R0;\n"
+ "RCP R1.x, R1.x;\n"
+ "RCP R1.y, R1.y;\n"
+ "RCP R1.z, R1.z;\n"
+ "MAD R1.xyz, R2, R1, R3;\n"
+ "MAD R3.xyz, fragment.color.primary.w, R0.w, R3;\n"
+ "MAD R2.xyz, fragment.color.primary, R0.w, R2;\n"
+ "ADD R3.xyz, R3, -R1;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R3, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORBURN =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.w, -R0, c[4].x;\n"
+ "MUL R1.xyz, R0, fragment.color.primary.w;\n"
+ "MAD R2.xyz, fragment.color.primary, R0.w, R1;\n"
+ "MAD R1.xyz, -fragment.color.primary.w, R0.w, R2;\n"
+ "MUL R3.xyz, fragment.color.primary.w, R1;\n"
+ "MAX R1.xyz, fragment.color.primary, c[4].y;\n"
+ "MUL R4.xyz, fragment.color.primary, R1.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "RCP R1.y, R1.y;\n"
+ "RCP R1.z, R1.z;\n"
+ "MAD R3.xyz, R3, R1, R4;\n"
+ "ADD R2.w, -fragment.color.primary, c[4].x;\n"
+ "MUL R1.xyz, R0, R2.w;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R2.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R3.xyz, R0, R2.w, R3;\n"
+ "MUL R1.w, fragment.color.primary, R0;\n"
+ "ADD R3.xyz, R3, -R1;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R3, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_HARDLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "ADD R0.w, -R1, c[4].y;\n"
+ "MUL R3.xyz, fragment.color.primary, R0.w;\n"
+ "ADD R2.xyz, fragment.color.primary.w, -fragment.color.primary;\n"
+ "ADD R0.xyz, R1.w, -R1;\n"
+ "MUL R0.xyz, R0, R2;\n"
+ "MUL R0.xyz, R0, c[4].x;\n"
+ "MAD R0.xyz, fragment.color.primary.w, R1.w, -R0;\n"
+ "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
+ "MUL R2.xyz, fragment.color.primary, R1;\n"
+ "MAD R2.xyz, R2, c[4].x, R3;\n"
+ "ADD R0.w, -fragment.color.primary, c[4].y;\n"
+ "MAD R3.xyz, R1, R0.w, R0;\n"
+ "MAD R2.xyz, R1, R0.w, R2;\n"
+ "MUL R0.xyz, fragment.color.primary, c[4].x;\n"
+ "SGE R0.xyz, R0, fragment.color.primary.w;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "MAD R2.xyz, R0, R3, R2;\n"
+ "ADD R0.z, fragment.color.primary.w, R1.w;\n"
+ "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..3],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.x, R0.w, c[4].y;\n"
+ "RCP R1.w, R1.x;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R1.xyz, -R2, c[4].w;\n"
+ "RSQ R2.w, R2.x;\n"
+ "ADD R4.xyz, R1, c[5].x;\n"
+ "MAD R1.xyz, -R0, R1.w, c[4].x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "RCP R2.x, R2.w;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R5.xyz, R2, R0.w, -R0;\n"
+ "MAD R2.xyz, fragment.color.primary, c[4].z, -fragment.color.primary.w;\n"
+ "MUL R3.xyz, R1, R2;\n"
+ "MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n"
+ "MUL R4.xyz, R5, R2;\n"
+ "MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
+ "MAD R5.xyz, R0, fragment.color.primary.w, R4;\n"
+ "MUL R3.xyz, R0, R3;\n"
+ "MUL R4.xyz, R0, c[4].w;\n"
+ "ADD R5.xyz, R5, -R3;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R4.xyz, R4, R5;\n"
+ "ADD R2.xyz, R3, R4;\n"
+ "MUL R1.xyz, R0, R1;\n"
+ "MUL R3.xyz, fragment.color.primary, c[4].z;\n"
+ "ADD R2.xyz, R2, -R1;\n"
+ "SGE R3.xyz, R3, fragment.color.primary.w;\n"
+ "MUL R2.xyz, R3, R2;\n"
+ "ADD R1.xyz, R1, R2;\n"
+ "ADD R1.w, -R0, c[4].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R0, R1.w, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DIFFERENCE =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, fragment.color.primary.w;\n"
+ "MUL R0.xyz, fragment.color.primary, R1.w;\n"
+ "MIN R0.xyz, R0, R2;\n"
+ "ADD R3.xyz, fragment.color.primary, R1;\n"
+ "MAD R2.xyz, -R0, c[4].x, R3;\n"
+ "ADD R0.z, fragment.color.primary.w, R1.w;\n"
+ "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_EXCLUSION =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..3],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[3];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MUL R0.xyz, R1, fragment.color.primary.w;\n"
+ "MAD R2.xyz, fragment.color.primary, R1.w, R0;\n"
+ "MUL R0.xyz, fragment.color.primary, R1;\n"
+ "MAD R0.xyz, -R0, c[4].y, R2;\n"
+ "ADD R0.w, -R1, c[4].x;\n"
+ "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
+ "ADD R0.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R1, R0.w, R0;\n"
+ "ADD R0.z, fragment.color.primary.w, R1.w;\n"
+ "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[4] = { program.local[0],\n"
+ " { 1 },\n"
+ " program.local[2..3] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.xyz, R0, c[3].y;\n"
+ "MUL R2.xyz, R1, fragment.color.primary.w;\n"
+ "MUL R1.xyz, fragment.color.primary, c[3].x;\n"
+ "MAD R2.xyz, R1, R0.w, R2;\n"
+ "MUL R0.xyz, R0, c[2].z;\n"
+ "ADD R1.w, -R0, c[1].x;\n"
+ "MUL R1.xyz, fragment.color.primary, c[2].y;\n"
+ "MAD R1.xyz, R1, R1.w, R2;\n"
+ "ADD R1.w, -fragment.color.primary, c[1].x;\n"
+ "MAD result.color.xyz, R0, R1.w, R1;\n"
+ "ADD R0.y, -R0.w, c[1].x;\n"
+ "MUL R0.x, fragment.color.primary.w, R0.w;\n"
+ "MUL R0.z, R0.w, R1.w;\n"
+ "MUL R0.y, fragment.color.primary.w, R0;\n"
+ "DP3 result.color.w, R0, c[2];\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_MULTIPLY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, -R0.w, c[1];\n"
+ "MUL R1.xyz, fragment.color.primary, R1.x;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "MAD R1.xyz, fragment.color.primary, R0, R1;\n"
+ "ADD R2.x, -fragment.color.primary.w, c[1];\n"
+ "MAD result.color.xyz, R0, R2.x, R1;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SCREEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[1] = { program.local[0] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1, fragment.color.primary, R0;\n"
+ "MAD result.color, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_OVERLAY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.w, -R0, c[1].y;\n"
+ "ADD R2.xyz, fragment.color.primary.w, -fragment.color.primary;\n"
+ "ADD R1.xyz, R0.w, -R0;\n"
+ "MUL R1.xyz, R1, R2;\n"
+ "MUL R1.xyz, R1, c[1].x;\n"
+ "MAD R1.xyz, fragment.color.primary.w, R0.w, -R1;\n"
+ "MUL R3.xyz, fragment.color.primary, R1.w;\n"
+ "MUL R2.xyz, fragment.color.primary, R0;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, -fragment.color.primary, c[1].y;\n"
+ "MAD R2.xyz, R2, c[1].x, R3;\n"
+ "MAD R2.xyz, R0, R1.w, R2;\n"
+ "MAD R1.xyz, R0, R1.w, R1;\n"
+ "MUL R0.xyz, R0, c[1].x;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "ADD R1.xyz, R1, -R2;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD result.color.xyz, R0, R1, R2;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DARKEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.xyz, fragment.color.primary, R0.w;\n"
+ "MIN R1.xyz, R1, R2;\n"
+ "ADD R1.w, -R0, c[1].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "ADD R2.x, -fragment.color.primary.w, c[1];\n"
+ "MAD result.color.xyz, R0, R2.x, R1;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_LIGHTEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.xyz, fragment.color.primary, R0.w;\n"
+ "MAX R1.xyz, R1, R2;\n"
+ "ADD R1.w, -R0, c[1].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "ADD R2.x, -fragment.color.primary.w, c[1];\n"
+ "MAD result.color.xyz, R0, R2.x, R1;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORDODGE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MAX R1.y, fragment.color.primary.w, c[1];\n"
+ "RCP R2.x, R1.y;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, -fragment.color.primary.w, c[1];\n"
+ "MUL R1.xyz, R0, R1.x;\n"
+ "ADD R1.w, -R0, c[1].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "MAD R2.xyz, -fragment.color.primary, R2.x, c[1].x;\n"
+ "MAX R2.xyz, R2, c[1].y;\n"
+ "MUL R0.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.w, fragment.color.primary, R0;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R0, R2, R1;\n"
+ "MAD R1.xyz, fragment.color.primary.w, R0.w, R1;\n"
+ "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
+ "SGE R0.xyz, R0, R1.w;\n"
+ "ADD R1.xyz, R1, -R2;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "MAD result.color.xyz, R0, R1, R2;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORBURN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.xyz, R0, fragment.color.primary.w;\n"
+ "MAD R2.xyz, fragment.color.primary, R0.w, R1;\n"
+ "MAD R1.xyz, -fragment.color.primary.w, R0.w, R2;\n"
+ "MUL R3.xyz, fragment.color.primary.w, R1;\n"
+ "MAX R1.xyz, fragment.color.primary, c[1].y;\n"
+ "ADD R1.w, -R0, c[1].x;\n"
+ "MUL R4.xyz, fragment.color.primary, R1.w;\n"
+ "ADD R2.w, -fragment.color.primary, c[1].x;\n"
+ "RCP R1.x, R1.x;\n"
+ "RCP R1.y, R1.y;\n"
+ "RCP R1.z, R1.z;\n"
+ "MAD R1.xyz, R3, R1, R4;\n"
+ "MUL R3.xyz, R0, R2.w;\n"
+ "ADD R2.w, -fragment.color.primary, c[1].x;\n"
+ "MAD R0.xyz, R0, R2.w, R1;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R3;\n"
+ "MUL R1.w, fragment.color.primary, R0;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "ADD R0.xyz, R0, -R1;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "MAD result.color.xyz, R2, R0, R1;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_HARDLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.w, -R0, c[1].y;\n"
+ "ADD R2.xyz, fragment.color.primary.w, -fragment.color.primary;\n"
+ "ADD R1.xyz, R0.w, -R0;\n"
+ "MUL R1.xyz, R1, R2;\n"
+ "MUL R1.xyz, R1, c[1].x;\n"
+ "MAD R1.xyz, fragment.color.primary.w, R0.w, -R1;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "MUL R3.xyz, fragment.color.primary, R1.w;\n"
+ "MUL R2.xyz, fragment.color.primary, R0;\n"
+ "ADD R1.w, -fragment.color.primary, c[1].y;\n"
+ "MAD R2.xyz, R2, c[1].x, R3;\n"
+ "MAD R2.xyz, R0, R1.w, R2;\n"
+ "MAD R0.xyz, R0, R1.w, R1;\n"
+ "ADD R1.xyz, R0, -R2;\n"
+ "MUL R0.xyz, fragment.color.primary, c[1].x;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "SGE R0.xyz, R0, fragment.color.primary.w;\n"
+ "MAD result.color.xyz, R0, R1, R2;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[3] = { program.local[0],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.x, R0.w, c[1].y;\n"
+ "RCP R1.w, R1.x;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R1.xyz, -R2, c[1].w;\n"
+ "ADD R4.xyz, R1, c[2].x;\n"
+ "MAD R1.xyz, -R0, R1.w, c[1].x;\n"
+ "RSQ R2.w, R2.x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "RCP R2.x, R2.w;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R5.xyz, R2, R0.w, -R0;\n"
+ "MAD R2.xyz, fragment.color.primary, c[1].z, -fragment.color.primary.w;\n"
+ "MUL R3.xyz, R1, R2;\n"
+ "MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n"
+ "MUL R4.xyz, R5, R2;\n"
+ "MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
+ "MAD R5.xyz, R0, fragment.color.primary.w, R4;\n"
+ "MUL R3.xyz, R0, R3;\n"
+ "MUL R4.xyz, R0, c[1].w;\n"
+ "ADD R5.xyz, R5, -R3;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R4.xyz, R4, R5;\n"
+ "ADD R2.xyz, R3, R4;\n"
+ "MUL R1.xyz, R0, R1;\n"
+ "MUL R3.xyz, fragment.color.primary, c[1].z;\n"
+ "ADD R2.xyz, R2, -R1;\n"
+ "SGE R3.xyz, R3, fragment.color.primary.w;\n"
+ "MUL R2.xyz, R3, R2;\n"
+ "ADD R1.xyz, R1, R2;\n"
+ "ADD R1.w, -R0, c[1].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "ADD R2.x, -fragment.color.primary.w, c[1];\n"
+ "MAD result.color.xyz, R0, R2.x, R1;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DIFFERENCE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.xyz, fragment.color.primary, R0.w;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "MIN R1.xyz, R1, R2;\n"
+ "ADD R0.xyz, fragment.color.primary, R0;\n"
+ "MAD result.color.xyz, -R1, c[1].x, R0;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_EXCLUSION_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[2] = { program.local[0],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.xyz, R0, fragment.color.primary.w;\n"
+ "MAD R2.xyz, fragment.color.primary, R0.w, R1;\n"
+ "MUL R1.xyz, fragment.color.primary, R0;\n"
+ "MAD R1.xyz, -R1, c[1].y, R2;\n"
+ "ADD R1.w, -R0, c[1].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, fragment.color.primary, R0;\n"
+ "ADD R2.x, -fragment.color.primary.w, c[1];\n"
+ "MAD result.color.xyz, R0, R2.x, R1;\n"
+ "MAD result.color.w, -fragment.color.primary, R0, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE_BLEND_MODE_MASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[3] = { program.local[0..2] };\n"
+ "TEMP R0;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MUL result.color, fragment.color.primary, R0.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE_BLEND_MODE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[1] = { program.local[0] };\n"
+ "MOV result.color, fragment.color.primary;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
+ "!!ARBfp1.0\n"
+ "PARAM c[12] = { program.local[0..6],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[8..11] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.z, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[7].x;\n"
+ "MUL R0.y, c[8].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, c[11].y;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[11].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "MUL R0.xyz, R0, c[10].y;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R0.xyz, R1, c[10].z;\n"
+ "ADD R3.z, -R0.w, c[7];\n"
+ "MAD R2.xyz, R0, R3.z, R2;\n"
+ "MUL R0.y, R0.w, R2.w;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.z, R1.w, R3;\n"
+ "DP3 R2.w, R0, c[10];\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_MULTIPLY =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.z, R0.y;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[7].x;\n"
+ "MUL R0.y, c[8].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2.x, -R1.w, c[7].z;\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, -R0.w, c[7].z;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SCREEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD R2, -R0, R1, R2;\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_OVERLAY =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[7].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].z;\n"
+ "MAD R3.xyz, R3, c[7].x, R4;\n"
+ "MAD R3.xyz, R1, R2.x, R3;\n"
+ "MAD R0.xyz, R1, R2.x, R0;\n"
+ "MUL R2.xyz, R1, c[7].x;\n"
+ "ADD R0.xyz, R0, -R3;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R0, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DARKEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].z;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_LIGHTEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].z;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORDODGE =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1, 1e-06 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAX R1.x, R0.w, c[7].w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R1.xyz, -R0, R1.x, c[7].z;\n"
+ "MAX R2.xyz, R1, c[7].w;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[7].z;\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "MAD R4.xyz, R0, R2.w, R3;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.w, R0, R1;\n"
+ "MAD R0.xyz, R0, R1.w, R3;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R3, R2, R4;\n"
+ "MAD R4.xyz, R0.w, R1.w, R4;\n"
+ "ADD R4.xyz, R4, -R2;\n"
+ "MAD R2.xyz, R0, R4, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORBURN =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1, 9.9999997e-06 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[7].w;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "ADD R3.w, -R0, c[7].z;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "MUL R2.w, R0, R1;\n"
+ "MAD R2.xyz, R1, R3.w, R2;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R3.xyz, R3, R2.w;\n"
+ "MAD R2.xyz, R3, R2, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_HARDLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[7].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[7].z;\n"
+ "MAD R3.xyz, R3, c[7].x, R4;\n"
+ "MUL R0.xyz, R0, c[7].x;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MAD R2.xyz, R0, R2, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SOFTLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..6],\n"
+ " { 2, 4, 1, 9.9999997e-06 },\n"
+ " program.local[8..9],\n"
+ " { 8, 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MAX R0.z, R1.w, c[7].w;\n"
+ "RCP R2.w, R0.z;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "MUL R6.xyz, -R2, c[10].x;\n"
+ "MAD R3.xyz, -R1, R2.w, c[7].z;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "MOV R0.y, c[7].x;\n"
+ "MUL R0.y, c[8].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAD R4.xyz, R0, c[7].x, -R0.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R3.xyz, -R3, R4, R0.w;\n"
+ "ADD R6.xyz, R6, c[10].y;\n"
+ "RSQ R2.x, R2.x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MAD R5.xyz, -R5, R6, R0.w;\n"
+ "MUL R3.xyz, R1, R3;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R2, R1.w, -R1;\n"
+ "MUL R6.xyz, R2, R4;\n"
+ "MUL R2.xyz, R1, R5;\n"
+ "MAD R6.xyz, R1, R0.w, R6;\n"
+ "MUL R4.xyz, R0, c[7].x;\n"
+ "MUL R5.xyz, R1, c[10].x;\n"
+ "ADD R6.xyz, R6, -R2;\n"
+ "SGE R5.xyz, R5, R1.w;\n"
+ "MUL R5.xyz, R5, R6;\n"
+ "ADD R2.xyz, R2, R5;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MUL R2.xyz, R4, R2;\n"
+ "ADD R2.xyz, R3, R2;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].z;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DIFFERENCE =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.z, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
+ "MOV R0.y, c[7].x;\n"
+ "MUL R0.y, c[8].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R3.xyz, R0, R1;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R0.xyz, R0, R1.w;\n"
+ "MIN R0.xyz, R0, R2;\n"
+ "MAD R2.xyz, -R0, c[7].x, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_EXCLUSION =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[8..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[8].x, -R0;\n"
+ "MUL R0.y, R0.z, c[7];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[7].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[8].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[9];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[7].x, R3;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].z;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..3],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[5..8] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.z, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, c[8].y;\n"
+ "MOV R0.y, c[4].x;\n"
+ "MUL R0.y, c[5].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[8].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MUL R0.xyz, R0, c[7].y;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[4].z;\n"
+ "MUL R1.xyz, R1, c[7].z;\n"
+ "MAD result.color.xyz, R1, R2.x, R0;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.z, R1.w, R2.x;\n"
+ "MUL R0.y, R0.w, R2.w;\n"
+ "DP3 result.color.w, R0, c[7];\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_MULTIPLY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.z, R0.y;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[4].x;\n"
+ "MUL R0.y, c[5].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R2.x, -R1.w, c[4].z;\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].z;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SCREEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.z, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "MOV R0.y, c[4].x;\n"
+ "MUL R0.y, c[5].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD result.color, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_OVERLAY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MUL R2.xyz, R2, c[4].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R2.w;\n"
+ "MUL R0.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[4].z;\n"
+ "MAD R0.xyz, R0, c[4].x, R3;\n"
+ "MAD R0.xyz, R1, R2.w, R0;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MUL R1.xyz, R1, c[4].x;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R1.xyz, R1, R1.w;\n"
+ "MAD result.color.xyz, R1, R2, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DARKEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].z;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_LIGHTEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].z;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORDODGE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1, 1e-06 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MAX R1.x, R0.w, c[4].w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R1.xyz, -R0, R1.x, c[4].z;\n"
+ "MAX R2.xyz, R1, c[4].w;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[4].z;\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R3.xyz, R0, R2.w, R3;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MAD R0.xyz, R0, R1.w, R1;\n"
+ "MUL R2.w, R0, R1;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R1, R2, R3;\n"
+ "MAD R3.xyz, R0.w, R1.w, R3;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "MAD result.color.xyz, R0, R3, R2;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORBURN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1, 9.9999997e-06 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[4].w;\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "ADD R3.w, -R0, c[4].z;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R1.xyz, R1, R3.w, R2;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "MUL R2.x, R0.w, R1.w;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R1.xyz, R1, -R0;\n"
+ "SGE R2.xyz, R3, R2.x;\n"
+ "MAD result.color.xyz, R2, R1, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_HARDLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[4].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R2.w, -R0, c[4].z;\n"
+ "MUL R0.xyz, R0, c[4].x;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MAD R3.xyz, R3, c[4].x, R4;\n"
+ "MAD R1.xyz, R1, R2.w, R3;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R2.xyz, R2, -R1;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD result.color.xyz, R0, R2, R1;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..3],\n"
+ " { 2, 4, 1, 9.9999997e-06 },\n"
+ " program.local[5..6],\n"
+ " { 8, 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MAX R0.z, R1.w, c[4].w;\n"
+ "RCP R2.w, R0.z;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "MUL R6.xyz, -R2, c[7].x;\n"
+ "MAD R3.xyz, -R1, R2.w, c[4].z;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "MOV R0.y, c[4].x;\n"
+ "MUL R0.y, c[5].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MAD R4.xyz, R0, c[4].x, -R0.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R3.xyz, -R3, R4, R0.w;\n"
+ "ADD R6.xyz, R6, c[7].y;\n"
+ "RSQ R2.x, R2.x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MAD R5.xyz, -R5, R6, R0.w;\n"
+ "MUL R3.xyz, R1, R3;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R2, R1.w, -R1;\n"
+ "MUL R6.xyz, R2, R4;\n"
+ "MUL R2.xyz, R1, R5;\n"
+ "MUL R4.xyz, R0, c[4].x;\n"
+ "MAD R6.xyz, R1, R0.w, R6;\n"
+ "MUL R5.xyz, R1, c[7].x;\n"
+ "ADD R6.xyz, R6, -R2;\n"
+ "SGE R5.xyz, R5, R1.w;\n"
+ "MUL R5.xyz, R5, R6;\n"
+ "ADD R2.xyz, R2, R5;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R2.xyz, R4, R2;\n"
+ "ADD R2.xyz, R3, R2;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].z;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DIFFERENCE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "ADD R0.xyz, R0, R1;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "MAD result.color.xyz, -R2, c[4].x, R0;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_EXCLUSION_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 2, 4, 1 },\n"
+ " program.local[5..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[4].x, R3;\n"
+ "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].z;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODE_BLEND_MODE_MASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..3],\n"
+ " { 2, 4 },\n"
+ " program.local[5..8] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "ADD R1.x, -R0, R0.y;\n"
+ "MOV R0.z, c[4].x;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "RCP R1.y, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "DP4 R1.y, R0, c[8];\n"
+ "TEX R0, R1, texture[1], 1D;\n"
+ "MUL result.color, R0, R1.y;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODE_BLEND_MODE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..3],\n"
+ " { 2, 4 },\n"
+ " program.local[5] };\n"
+ "TEMP R0;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "ADD R0.z, R0, R0.w;\n"
+ "MUL R0.z, c[5].x, -R0;\n"
+ "MUL R0.y, R0.z, c[4];\n"
+ "MUL R0.x, R0, c[4];\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "MOV R0.z, c[4].x;\n"
+ "RSQ R0.y, R0.y;\n"
+ "MUL R0.z, c[5].x, R0;\n"
+ "RCP R0.y, R0.y;\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.x, R0, R0.z;\n"
+ "TEX result.color, R0, texture[0], 1D;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
+ "!!ARBfp1.0\n"
+ "PARAM c[13] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494 },\n"
+ " program.local[10..12] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, c[12].y;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[12].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "MUL R0.xyz, R0, c[11].y;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R0.xyz, R1, c[11].z;\n"
+ "ADD R3.z, -R0.w, c[7].w;\n"
+ "MAD R2.xyz, R0, R3.z, R2;\n"
+ "MUL R0.y, R0.w, R2.w;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.z, R1.w, R3;\n"
+ "DP3 R2.w, R0, c[11];\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2.x, -R1.w, c[7].w;\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, -R0.w, c[7].w;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD R2, -R0, R1, R2;\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[9].y;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].w;\n"
+ "MAD R3.xyz, R3, c[9].y, R4;\n"
+ "MAD R3.xyz, R1, R2.x, R3;\n"
+ "MAD R0.xyz, R1, R2.x, R0;\n"
+ "MUL R2.xyz, R1, c[9].y;\n"
+ "ADD R0.xyz, R0, -R3;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R0, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].w;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].w;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494, 1e-06 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAX R1.x, R0.w, c[9].y;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R1.xyz, -R0, R1.x, c[7].w;\n"
+ "MAX R2.xyz, R1, c[9].y;\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[7];\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "MAD R4.xyz, R0, R2.w, R3;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.w, R0, R1;\n"
+ "MAD R0.xyz, R0, R1.w, R3;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R3, R2, R4;\n"
+ "MAD R4.xyz, R0.w, R1.w, R4;\n"
+ "ADD R4.xyz, R4, -R2;\n"
+ "MAD R2.xyz, R0, R4, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494, 9.9999997e-06 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[9].y;\n"
+ "ADD R3.w, -R0, c[7];\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "MUL R2.w, R0, R1;\n"
+ "MAD R2.xyz, R1, R3.w, R2;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R3.xyz, R3, R2.w;\n"
+ "MAD R2.xyz, R3, R2, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[9].y;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[7];\n"
+ "MAD R3.xyz, R3, c[9].y, R4;\n"
+ "MUL R0.xyz, R0, c[9].y;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MAD R2.xyz, R0, R2, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[12] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494, 9.9999997e-06, 2, 8 },\n"
+ " program.local[10],\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MOV R1.x, c[7].y;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "MAX R0.z, R1.w, c[9].y;\n"
+ "RCP R2.w, R0.z;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "RSQ R3.w, R2.x;\n"
+ "RSQ R4.y, R2.z;\n"
+ "RCP R4.x, R3.w;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAD R3.xyz, R0, c[9].z, -R0.w;\n"
+ "RSQ R3.w, R2.y;\n"
+ "RCP R4.z, R4.y;\n"
+ "RCP R4.y, R3.w;\n"
+ "MAD R4.xyz, R4, R1.w, -R1;\n"
+ "MUL R6.xyz, R4, R3;\n"
+ "MUL R4.xyz, -R2, c[9].w;\n"
+ "MAD R2.xyz, -R1, R2.w, c[7].w;\n"
+ "ADD R5.xyz, R4, c[11].x;\n"
+ "MUL R4.xyz, R2, R3;\n"
+ "MAD R4.xyz, -R4, R5, R0.w;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R5.xyz, R1, R0.w, R6;\n"
+ "MUL R4.xyz, R1, R4;\n"
+ "MUL R6.xyz, R1, c[9].w;\n"
+ "ADD R5.xyz, R5, -R4;\n"
+ "SGE R6.xyz, R6, R1.w;\n"
+ "MUL R5.xyz, R6, R5;\n"
+ "ADD R3.xyz, R4, R5;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MUL R4.xyz, R0, c[9].z;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R3.xyz, R4, R3;\n"
+ "ADD R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].w;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R3.xyz, R0, R1;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R0.xyz, R0, R1.w;\n"
+ "MIN R0.xyz, R0, R2;\n"
+ "MAD R2.xyz, -R0, c[9].y, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..5],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[8],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[6].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[6].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[7].y;\n"
+ "CMP R0.x, R0, c[7], R1;\n"
+ "MAD R0.w, R0, c[6].z, -c[6];\n"
+ "MUL R1.xy, fragment.position, c[10];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[7].z, c[7].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[8];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[9].y, R3;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[7].w;\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494 },\n"
+ " program.local[7..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, c[9].y;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[9].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "MUL R0.xyz, R0, c[8].y;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[4].w;\n"
+ "MUL R1.xyz, R1, c[8].z;\n"
+ "MAD result.color.xyz, R1, R2.x, R0;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.z, R1.w, R2.x;\n"
+ "MUL R0.y, R0.w, R2.w;\n"
+ "DP3 result.color.w, R0, c[8];\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R2.x, -R1.w, c[4].w;\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].w;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD result.color, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[6].y;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R2.w;\n"
+ "MUL R0.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[4];\n"
+ "MAD R0.xyz, R0, c[6].y, R3;\n"
+ "MAD R0.xyz, R1, R2.w, R0;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MUL R1.xyz, R1, c[6].y;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R1.xyz, R1, R1.w;\n"
+ "MAD result.color.xyz, R1, R2, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].w;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].w;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494, 1e-06 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MAX R1.x, R0.w, c[6].y;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R1.xyz, -R0, R1.x, c[4].w;\n"
+ "MAX R2.xyz, R1, c[6].y;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[4];\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "MAD R3.xyz, R0, R2.w, R3;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MAD R0.xyz, R0, R1.w, R1;\n"
+ "MUL R2.w, R0, R1;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R1, R2, R3;\n"
+ "MAD R3.xyz, R0.w, R1.w, R3;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "MAD result.color.xyz, R0, R3, R2;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494, 9.9999997e-06 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[6].y;\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "ADD R3.w, -R0, c[4];\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R1.xyz, R1, R3.w, R2;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "MUL R2.x, R0.w, R1.w;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R1.xyz, R1, -R0;\n"
+ "SGE R2.xyz, R3, R2.x;\n"
+ "MAD result.color.xyz, R2, R1, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[6].y;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R2.w, -R0, c[4];\n"
+ "MUL R0.xyz, R0, c[6].y;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MAD R3.xyz, R3, c[6].y, R4;\n"
+ "MAD R1.xyz, R1, R2.w, R3;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R2.xyz, R2, -R1;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD result.color.xyz, R0, R2, R1;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494, 9.9999997e-06, 2, 8 },\n"
+ " program.local[7],\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MOV R1.x, c[4].y;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "MAX R0.z, R1.w, c[6].y;\n"
+ "RCP R2.w, R0.z;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "RSQ R3.w, R2.x;\n"
+ "RSQ R4.y, R2.z;\n"
+ "RCP R4.x, R3.w;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MAD R3.xyz, R0, c[6].z, -R0.w;\n"
+ "RSQ R3.w, R2.y;\n"
+ "RCP R4.z, R4.y;\n"
+ "RCP R4.y, R3.w;\n"
+ "MAD R4.xyz, R4, R1.w, -R1;\n"
+ "MUL R6.xyz, R4, R3;\n"
+ "MUL R4.xyz, -R2, c[6].w;\n"
+ "MAD R2.xyz, -R1, R2.w, c[4].w;\n"
+ "ADD R5.xyz, R4, c[8].x;\n"
+ "MUL R4.xyz, R2, R3;\n"
+ "MAD R4.xyz, -R4, R5, R0.w;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R5.xyz, R1, R0.w, R6;\n"
+ "MUL R4.xyz, R1, R4;\n"
+ "MUL R6.xyz, R1, c[6].w;\n"
+ "ADD R5.xyz, R5, -R4;\n"
+ "SGE R6.xyz, R6, R1.w;\n"
+ "MUL R5.xyz, R6, R5;\n"
+ "ADD R3.xyz, R4, R5;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MUL R4.xyz, R0, c[6].z;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R3.xyz, R4, R3;\n"
+ "ADD R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].w;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "ADD R0.xyz, R0, R1;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "MAD result.color.xyz, -R2, c[6].y, R0;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494, 2 },\n"
+ " program.local[7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[6].y, R3;\n"
+ "ADD R2.w, -R1, c[4];\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[4].w;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_MASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494 },\n"
+ " program.local[7..9] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.y, R0.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.z, R0.x, R0.y, c[5].x;\n"
+ "MUL R1.x, R0.z, c[6];\n"
+ "FLR R1.y, R1.x;\n"
+ "ADD R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, R0, c[8];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, R1, -R1.y;\n"
+ "DP4 R1.y, R0, c[9];\n"
+ "TEX R0, R1, texture[1], 1D;\n"
+ "MUL result.color, R0, R1.y;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..2],\n"
+ " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
+ " { 2.3561945, 0.78539819, -1, 1 },\n"
+ " program.local[5],\n"
+ " { 0.15915494 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "ABS R0.w, R0.x;\n"
+ "ABS R0.z, R0.y;\n"
+ "ADD R0.z, R0, -R0.w;\n"
+ "ADD R0.w, R0.y, c[3].x;\n"
+ "ABS R0.z, R0;\n"
+ "CMP R0.y, -R0.z, R0, R0.w;\n"
+ "ABS R0.z, -R0.y;\n"
+ "ADD R0.z, R0, c[3].y;\n"
+ "ADD R0.w, R0.x, R0.z;\n"
+ "ADD R1.x, R0.z, -R0;\n"
+ "RCP R1.x, R1.x;\n"
+ "RCP R1.y, R0.w;\n"
+ "MUL R0.w, R0, R1.x;\n"
+ "ADD R0.z, R0.x, -R0;\n"
+ "MUL R0.z, R0, R1.y;\n"
+ "CMP R0.z, R0.x, R0.w, R0;\n"
+ "MUL R0.w, R0.z, R0.z;\n"
+ "MOV R1.x, c[4].y;\n"
+ "CMP R0.y, -R0, c[4].z, c[4].w;\n"
+ "MAD R0.w, R0, c[3].z, -c[3];\n"
+ "CMP R0.x, R0, c[4], R1;\n"
+ "MAD R0.x, R0.w, R0.z, R0;\n"
+ "MAD R0.x, R0, R0.y, c[5];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "FLR R0.y, R0.x;\n"
+ "ADD R0.x, R0, -R0.y;\n"
+ "TEX result.color, R0, texture[0], 1D;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 1 },\n"
+ " program.local[9..10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, c[10].y;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[10].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "MUL R0.xyz, R0, c[9].y;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R0.xyz, R1, c[9].z;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.y, -R1.w, c[8].x;\n"
+ "MUL R0.z, R1.w, R2.w;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.y, R0.w, R0;\n"
+ "DP3 R2.w, R0, c[9];\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_MULTIPLY =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SCREEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD R2, -R0, R1, R2;\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_OVERLAY =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[8].y;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[8].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8].y;\n"
+ "MAD R3.xyz, R3, c[8].x, R4;\n"
+ "MAD R3.xyz, R1, R2.x, R3;\n"
+ "MAD R0.xyz, R1, R2.x, R0;\n"
+ "MUL R2.xyz, R1, c[8].x;\n"
+ "ADD R0.xyz, R0, -R3;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R0, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DARKEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_LIGHTEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORDODGE =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MAX R1.x, R0.w, c[8].y;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R2.xyz, -R0, R1.x, c[8].x;\n"
+ "MAX R2.xyz, R2, c[8].y;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R4.xyz, R0, R2.w, R3;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.w, R0, R1;\n"
+ "MAD R0.xyz, R0, R1.w, R3;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R3, R2, R4;\n"
+ "MAD R4.xyz, R0.w, R1.w, R4;\n"
+ "ADD R4.xyz, R4, -R2;\n"
+ "MAD R2.xyz, R0, R4, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORBURN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[8].y;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "ADD R3.w, -R0, c[8].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "MUL R2.w, R0, R1;\n"
+ "ADD R3.w, -R0, c[8].x;\n"
+ "MAD R2.xyz, R1, R3.w, R2;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R3.xyz, R3, R2.w;\n"
+ "MAD R2.xyz, R3, R2, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_HARDLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[8].y;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[8].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[8].y;\n"
+ "MAD R3.xyz, R3, c[8].x, R4;\n"
+ "MUL R0.xyz, R0, c[8].x;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MAD R2.xyz, R0, R2, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..7],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R2.xyz, fragment.position.y, c[4];\n"
+ "MAD R3.xyz, fragment.position.x, c[3], R2;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MAX R0.x, R1.w, c[8].y;\n"
+ "RCP R2.w, R0.x;\n"
+ "MUL R0.xyz, R1, R2.w;\n"
+ "RSQ R0.w, R0.x;\n"
+ "RSQ R2.y, R0.y;\n"
+ "ADD R3.xyz, R3, c[5];\n"
+ "RCP R2.x, R0.w;\n"
+ "RCP R0.w, R3.z;\n"
+ "MUL R3.xy, R3, R0.w;\n"
+ "RSQ R0.w, R0.z;\n"
+ "RCP R2.z, R0.w;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R6.xyz, R2, R1.w, -R1;\n"
+ "MUL R2.xyz, -R0, c[8].w;\n"
+ "ADD R5.xyz, R2, c[9].x;\n"
+ "MAD R2.xyz, -R1, R2.w, c[8].x;\n"
+ "MUL R3.xy, R3, c[6];\n"
+ "ADD R0.w, R3.x, R3.y;\n"
+ "MUL R0.w, R0, c[6].z;\n"
+ "TEX R0, R0.w, texture[2], 1D;\n"
+ "MAD R3.xyz, R0, c[8].z, -R0.w;\n"
+ "MUL R4.xyz, R2, R3;\n"
+ "MAD R4.xyz, -R4, R5, R0.w;\n"
+ "MUL R5.xyz, R6, R3;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R6.xyz, R1, R0.w, R5;\n"
+ "MUL R4.xyz, R1, R4;\n"
+ "MUL R5.xyz, R1, c[8].w;\n"
+ "ADD R6.xyz, R6, -R4;\n"
+ "SGE R5.xyz, R5, R1.w;\n"
+ "MUL R5.xyz, R5, R6;\n"
+ "ADD R3.xyz, R4, R5;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MUL R4.xyz, R0, c[8].z;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R3.xyz, R4, R3;\n"
+ "ADD R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DIFFERENCE =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "ADD R3.xyz, R0, R1;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R0.xyz, R0, R1.w;\n"
+ "MIN R0.xyz, R0, R2;\n"
+ "MAD R2.xyz, -R0, c[8].x, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_EXCLUSION =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[6].z;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[8].y, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 1 },\n"
+ " program.local[6..7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, c[7].y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[7].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "MUL R0.xyz, R0, c[6].y;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[5];\n"
+ "MUL R1.xyz, R1, c[6].z;\n"
+ "MAD result.color.xyz, R1, R2.x, R0;\n"
+ "ADD R0.y, -R1.w, c[5].x;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.z, R1.w, R2.x;\n"
+ "MUL R0.y, R0.w, R0;\n"
+ "DP3 result.color.w, R0, c[6];\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_MULTIPLY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R2.x, -R1.w, c[5];\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SCREEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..4] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD result.color, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_OVERLAY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
+ "MUL R2.xyz, R2, c[5].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R2.w;\n"
+ "MUL R0.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
+ "MAD R0.xyz, R0, c[5].x, R3;\n"
+ "MAD R0.xyz, R1, R2.w, R0;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MUL R1.xyz, R1, c[5].x;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R1.xyz, R1, R1.w;\n"
+ "MAD result.color.xyz, R1, R2, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DARKEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_LIGHTEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORDODGE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MAX R1.x, R0.w, c[5].y;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R3.xyz, -R0, R1.x, c[5].x;\n"
+ "MAX R3.xyz, R3, c[5].y;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.x, -R0.w, c[5];\n"
+ "MUL R2.xyz, R1, R2.x;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MAD R0.xyz, R0, R1.w, R1;\n"
+ "MUL R2.w, R0, R1;\n"
+ "RCP R3.x, R3.x;\n"
+ "RCP R3.y, R3.y;\n"
+ "RCP R3.z, R3.z;\n"
+ "MAD R3.xyz, R1, R3, R2;\n"
+ "MAD R2.xyz, R0.w, R1.w, R2;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "MAD result.color.xyz, R0, R2, R3;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORBURN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[5].y;\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "ADD R3.w, -R0, c[5].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "ADD R3.w, -R0, c[5].x;\n"
+ "MAD R1.xyz, R1, R3.w, R2;\n"
+ "MUL R2.x, R0.w, R1.w;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R1.xyz, R1, -R0;\n"
+ "SGE R2.xyz, R3, R2.x;\n"
+ "MAD result.color.xyz, R2, R1, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_HARDLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[5].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MUL R0.xyz, R0, c[5].x;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
+ "MAD R3.xyz, R3, c[5].x, R4;\n"
+ "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R1.xyz, R1, -R3;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD result.color.xyz, R0, R1, R3;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..4],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R2.xyz, fragment.position.y, c[1];\n"
+ "MAD R3.xyz, fragment.position.x, c[0], R2;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MAX R0.x, R1.w, c[5].y;\n"
+ "RCP R2.w, R0.x;\n"
+ "MUL R0.xyz, R1, R2.w;\n"
+ "RSQ R0.w, R0.x;\n"
+ "RSQ R2.y, R0.y;\n"
+ "ADD R3.xyz, R3, c[2];\n"
+ "RCP R2.x, R0.w;\n"
+ "RCP R0.w, R3.z;\n"
+ "MUL R3.xy, R3, R0.w;\n"
+ "RSQ R0.w, R0.z;\n"
+ "RCP R2.z, R0.w;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R6.xyz, R2, R1.w, -R1;\n"
+ "MUL R2.xyz, -R0, c[5].w;\n"
+ "ADD R5.xyz, R2, c[6].x;\n"
+ "MAD R2.xyz, -R1, R2.w, c[5].x;\n"
+ "MUL R3.xy, R3, c[3];\n"
+ "ADD R0.w, R3.x, R3.y;\n"
+ "MUL R0.w, R0, c[3].z;\n"
+ "TEX R0, R0.w, texture[1], 1D;\n"
+ "MAD R3.xyz, R0, c[5].z, -R0.w;\n"
+ "MUL R4.xyz, R2, R3;\n"
+ "MAD R4.xyz, -R4, R5, R0.w;\n"
+ "MUL R5.xyz, R6, R3;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R6.xyz, R1, R0.w, R5;\n"
+ "MUL R4.xyz, R1, R4;\n"
+ "MUL R5.xyz, R1, c[5].w;\n"
+ "ADD R6.xyz, R6, -R4;\n"
+ "SGE R5.xyz, R5, R1.w;\n"
+ "MUL R5.xyz, R5, R6;\n"
+ "ADD R3.xyz, R4, R5;\n"
+ "MUL R2.xyz, R1, R2;\n"
+ "MUL R4.xyz, R0, c[5].z;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R3.xyz, R4, R3;\n"
+ "ADD R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DIFFERENCE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "ADD R0.xyz, R0, R1;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "MAD result.color.xyz, -R2, c[5].x, R0;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_EXCLUSION_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[1], 1D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[5].y, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODE_BLEND_MODE_MASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R0.zw, R0, c[3].xyxy;\n"
+ "ADD R1.x, R0.z, R0.w;\n"
+ "ADD R0.xy, fragment.position, c[4];\n"
+ "MUL R0.xy, R0, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "DP4 R1.y, R0, c[6];\n"
+ "MUL R1.x, R1, c[3].z;\n"
+ "TEX R0, R1, texture[1], 1D;\n"
+ "MUL result.color, R0, R1.y;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODE_BLEND_MODE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[4] = { program.local[0..3] };\n"
+ "TEMP R0;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "ADD R0.x, R0, R0.y;\n"
+ "MUL R0.x, R0, c[3].z;\n"
+ "TEX result.color, R0, texture[0], 1D;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 1 },\n"
+ " program.local[9..10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MUL R2.xyz, R1, c[10].y;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[10].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "MUL R0.xyz, R0, c[9].y;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MUL R0.xyz, R1, c[9].z;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.y, -R1.w, c[8].x;\n"
+ "MUL R0.z, R1.w, R2.w;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.y, R0.w, R0;\n"
+ "DP3 R2.w, R0, c[9];\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_MULTIPLY =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R1.x, R0.z;\n"
+ "MUL R0.xy, R0, R1.x;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SCREEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD R2, -R0, R1, R2;\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_OVERLAY =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[8].y;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[8].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8].y;\n"
+ "MAD R3.xyz, R3, c[8].x, R4;\n"
+ "MAD R3.xyz, R1, R2.x, R3;\n"
+ "MAD R0.xyz, R1, R2.x, R0;\n"
+ "MUL R2.xyz, R1, c[8].x;\n"
+ "ADD R0.xyz, R0, -R3;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R0, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DARKEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_LIGHTEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORDODGE =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MAX R1.x, R0.w, c[8].y;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R1.xyz, -R0, R1.x, c[8].x;\n"
+ "MAX R2.xyz, R1, c[8].y;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R4.xyz, R0, R2.w, R3;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.w, R0, R1;\n"
+ "MAD R0.xyz, R0, R1.w, R3;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R3, R2, R4;\n"
+ "MAD R4.xyz, R0.w, R1.w, R4;\n"
+ "ADD R4.xyz, R4, -R2;\n"
+ "MAD R2.xyz, R0, R4, R2;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORBURN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[8].y;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "ADD R3.w, -R0, c[8].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "MUL R2.w, R0, R1;\n"
+ "ADD R3.w, -R0, c[8].x;\n"
+ "MAD R2.xyz, R1, R3.w, R2;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R3.xyz, R3, R2.w;\n"
+ "MAD R2.xyz, R3, R2, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_HARDLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[8].y;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[8].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[8].y;\n"
+ "MAD R3.xyz, R3, c[8].x, R4;\n"
+ "MUL R0.xyz, R0, c[8].x;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MAD R2.xyz, R0, R2, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..7],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MAX R0.z, R1.w, c[8].y;\n"
+ "RCP R2.w, R0.z;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "MUL R6.xyz, -R2, c[8].w;\n"
+ "MAD R3.xyz, -R1, R2.w, c[8].x;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MAD R4.xyz, R0, c[8].z, -R0.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R3.xyz, -R3, R4, R0.w;\n"
+ "ADD R6.xyz, R6, c[9].x;\n"
+ "RSQ R2.x, R2.x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MAD R5.xyz, -R5, R6, R0.w;\n"
+ "MUL R3.xyz, R1, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R2, R1.w, -R1;\n"
+ "MUL R6.xyz, R2, R4;\n"
+ "MUL R2.xyz, R1, R5;\n"
+ "MAD R6.xyz, R1, R0.w, R6;\n"
+ "MUL R4.xyz, R0, c[8].z;\n"
+ "MUL R5.xyz, R1, c[8].w;\n"
+ "ADD R6.xyz, R6, -R2;\n"
+ "SGE R5.xyz, R5, R1.w;\n"
+ "MUL R5.xyz, R5, R6;\n"
+ "ADD R2.xyz, R2, R5;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MUL R2.xyz, R4, R2;\n"
+ "ADD R2.xyz, R3, R2;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DIFFERENCE =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "ADD R3.xyz, R0, R1;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R0.xyz, R0, R1.w;\n"
+ "MIN R0.xyz, R0, R2;\n"
+ "MAD R2.xyz, -R0, c[8].x, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_EXCLUSION =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[2], 2D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[8].y, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 1 },\n"
+ " program.local[6..7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, c[7].y;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[7].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "MUL R0.xyz, R0, c[6].y;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[5];\n"
+ "MUL R1.xyz, R1, c[6].z;\n"
+ "MAD result.color.xyz, R1, R2.x, R0;\n"
+ "ADD R0.y, -R1.w, c[5].x;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.z, R1.w, R2.x;\n"
+ "MUL R0.y, R0.w, R0;\n"
+ "DP3 result.color.w, R0, c[6];\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_MULTIPLY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R1.x, R0.z;\n"
+ "MUL R0.xy, R0, R1.x;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2.x, -R1.w, c[5];\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SCREEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..4] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R0, R1;\n"
+ "MAD result.color, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_OVERLAY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
+ "MUL R2.xyz, R2, c[5].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R3.xyz, R0, R2.w;\n"
+ "MUL R0.xyz, R0, R1;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
+ "MAD R0.xyz, R0, c[5].x, R3;\n"
+ "MAD R0.xyz, R1, R2.w, R0;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MUL R1.xyz, R1, c[5].x;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R1.xyz, R1, R1.w;\n"
+ "MAD result.color.xyz, R1, R2, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DARKEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_LIGHTEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORDODGE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MAX R1.x, R0.w, c[5].y;\n"
+ "RCP R1.x, R1.x;\n"
+ "MAD R1.xyz, -R0, R1.x, c[5].x;\n"
+ "MAX R2.xyz, R1, c[5].y;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R3.xyz, R0, R2.w, R3;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MAD R0.xyz, R0, R1.w, R1;\n"
+ "MUL R2.w, R0, R1;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R1, R2, R3;\n"
+ "MAD R3.xyz, R0.w, R1.w, R3;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "MAD result.color.xyz, R0, R3, R2;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORBURN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R2.xyz, -R0.w, R1.w, R3;\n"
+ "MUL R4.xyz, R0.w, R2;\n"
+ "MAX R2.xyz, R0, c[5].y;\n"
+ "MUL R5.xyz, R0, R2.w;\n"
+ "ADD R3.w, -R0, c[5].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R1, R3.w;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
+ "ADD R3.w, -R0, c[5].x;\n"
+ "MAD R1.xyz, R1, R3.w, R2;\n"
+ "MUL R2.x, R0.w, R1.w;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R1.xyz, R1, -R0;\n"
+ "SGE R2.xyz, R3, R2.x;\n"
+ "MAD result.color.xyz, R2, R1, R0;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_HARDLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
+ "ADD R3.xyz, R0.w, -R0;\n"
+ "ADD R2.xyz, R1.w, -R1;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[5].x;\n"
+ "MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MUL R4.xyz, R0, R2.w;\n"
+ "MUL R3.xyz, R0, R1;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
+ "MUL R0.xyz, R0, c[5].x;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MAD R3.xyz, R3, c[5].x, R4;\n"
+ "MAD R1.xyz, R1, R2.w, R3;\n"
+ "ADD R2.w, R0, R1;\n"
+ "ADD R2.xyz, R2, -R1;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD result.color.xyz, R0, R2, R1;\n"
+ "MAD result.color.w, -R0, R1, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..4],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MAX R0.z, R1.w, c[5].y;\n"
+ "RCP R2.w, R0.z;\n"
+ "MUL R2.xyz, R1, R2.w;\n"
+ "MUL R6.xyz, -R2, c[5].w;\n"
+ "MAD R3.xyz, -R1, R2.w, c[5].x;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MAD R4.xyz, R0, c[5].z, -R0.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R3.xyz, -R3, R4, R0.w;\n"
+ "ADD R6.xyz, R6, c[6].x;\n"
+ "RSQ R2.x, R2.x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MAD R5.xyz, -R5, R6, R0.w;\n"
+ "MUL R3.xyz, R1, R3;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R2, R1.w, -R1;\n"
+ "MUL R6.xyz, R2, R4;\n"
+ "MUL R2.xyz, R1, R5;\n"
+ "MUL R4.xyz, R0, c[5].z;\n"
+ "MAD R6.xyz, R1, R0.w, R6;\n"
+ "MUL R5.xyz, R1, c[5].w;\n"
+ "ADD R6.xyz, R6, -R2;\n"
+ "SGE R5.xyz, R5, R1.w;\n"
+ "MUL R5.xyz, R5, R6;\n"
+ "ADD R2.xyz, R2, R5;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "SGE R4.xyz, R4, R0.w;\n"
+ "MUL R2.xyz, R4, R2;\n"
+ "ADD R2.xyz, R3, R2;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DIFFERENCE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "ADD R0.xyz, R0, R1;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R1.x, R0.w, R1.w;\n"
+ "MAD result.color.xyz, -R2, c[5].x, R0;\n"
+ "MAD result.color.w, -R0, R1, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_EXCLUSION_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[5].y, R3;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R2.y, -R0.w, c[5].x;\n"
+ "MAD result.color.xyz, R1, R2.y, R0;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODE_BLEND_MODE_MASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R1.xyz, R0, c[2];\n"
+ "RCP R0.z, R1.z;\n"
+ "MUL R1.xy, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[4];\n"
+ "MUL R0.xy, R0, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "DP4 R1.z, R0, c[6];\n"
+ "MUL R1.xy, R1, c[3];\n"
+ "MOV R0.x, R1;\n"
+ "MOV R0.y, -R1;\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "MUL result.color, R0, R1.z;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODE_BLEND_MODE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[4] = { program.local[0..3] };\n"
+ "TEMP R0;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX result.color, R0, texture[0], 2D;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
+ "!!ARBfp1.0\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 1 },\n"
+ " program.local[9..10] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "MUL R0, fragment.color.primary, R0.x;\n"
+ "MUL R2.xyz, R1, c[10].y;\n"
+ "MUL R3.xyz, R2, R0.w;\n"
+ "MUL R2.xyz, R0, c[10].x;\n"
+ "MAD R2.xyz, R2, R1.w, R3;\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "MUL R0.xyz, R0, c[9].y;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MUL R0.xyz, R1, c[9].z;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R0.y, -R1.w, c[8].x;\n"
+ "MUL R0.z, R1.w, R2.w;\n"
+ "MUL R0.x, R0.w, R1.w;\n"
+ "MUL R0.y, R0.w, R0;\n"
+ "DP3 R2.w, R0, c[9];\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_MULTIPLY =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "MUL R0, fragment.color.primary, R0.x;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MUL R2.xyz, R0, R2.x;\n"
+ "MAD R0.xyz, R0, R1, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "ADD R3.xy, fragment.position, c[0];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "ADD R2, R1, R0;\n"
+ "MAD R2, -R1, R0, R2;\n"
+ "MUL R3.xy, R3, c[1];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[8].y;\n"
+ "ADD R3.xyz, R1.w, -R1;\n"
+ "ADD R2.xyz, R0.w, -R0;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[8].x;\n"
+ "MAD R2.xyz, R1.w, R0.w, -R2;\n"
+ "MUL R4.xyz, R1, R2.w;\n"
+ "MUL R3.xyz, R1, R0;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8].y;\n"
+ "MAD R3.xyz, R3, c[8].x, R4;\n"
+ "MAD R3.xyz, R0, R2.x, R3;\n"
+ "MAD R1.xyz, R0, R2.x, R1;\n"
+ "MUL R2.xyz, R0, c[8].x;\n"
+ "ADD R1.xyz, R1, -R3;\n"
+ "SGE R2.xyz, R2, R0.w;\n"
+ "MAD R2.xyz, R2, R1, R3;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DARKEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0, fragment.color.primary, R0.x;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_LIGHTEN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0, fragment.color.primary, R0.x;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORDODGE =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "MUL R1, fragment.color.primary, R0.x;\n"
+ "MAX R0.x, R1.w, c[8].y;\n"
+ "RCP R0.x, R0.x;\n"
+ "MAD R0.xyz, -R1, R0.x, c[8].x;\n"
+ "MAX R2.xyz, R0, c[8].y;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MUL R3.xyz, R0, R2.w;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R4.xyz, R1, R2.w, R3;\n"
+ "MUL R3.xyz, R0, R1.w;\n"
+ "MUL R2.w, R1, R0;\n"
+ "MAD R1.xyz, R1, R0.w, R3;\n"
+ "SGE R1.xyz, R1, R2.w;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R3, R2, R4;\n"
+ "MAD R4.xyz, R1.w, R0.w, R4;\n"
+ "ADD R4.xyz, R4, -R2;\n"
+ "MAD R2.xyz, R1, R4, R2;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORBURN =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "MAD R2.xyz, -R1.w, R0.w, R3;\n"
+ "MUL R4.xyz, R1.w, R2;\n"
+ "MAX R2.xyz, R1, c[8].y;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MUL R5.xyz, R1, R2.w;\n"
+ "ADD R3.w, -R1, c[8].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R0, R3.w;\n"
+ "MAD R1.xyz, R1, R2.w, R4;\n"
+ "MUL R2.w, R1, R0;\n"
+ "ADD R3.w, -R1, c[8].x;\n"
+ "MAD R2.xyz, R0, R3.w, R2;\n"
+ "ADD R2.xyz, R2, -R1;\n"
+ "SGE R3.xyz, R3, R2.w;\n"
+ "MAD R2.xyz, R3, R2, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[2], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[8].y;\n"
+ "ADD R3.xyz, R1.w, -R1;\n"
+ "ADD R2.xyz, R0.w, -R0;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[8].x;\n"
+ "MAD R2.xyz, R1.w, R0.w, -R2;\n"
+ "MUL R4.xyz, R1, R2.w;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MUL R3.xyz, R1, R0;\n"
+ "ADD R2.w, -R1, c[8].y;\n"
+ "MAD R3.xyz, R3, c[8].x, R4;\n"
+ "MUL R1.xyz, R1, c[8].x;\n"
+ "SGE R1.xyz, R1, R1.w;\n"
+ "MAD R3.xyz, R0, R2.w, R3;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MAD R2.xyz, R1, R2, R3;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT =
+ "!!ARBfp1.0\n"
+ "PARAM c[10] = { program.local[0..7],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R1.xyz, R0, c[5];\n"
+ "RCP R0.z, R1.z;\n"
+ "MUL R1.xy, R1, R0.z;\n"
+ "MUL R1.xy, R1, c[6];\n"
+ "MOV R1.y, -R1;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.z, R0.w, c[8].y;\n"
+ "RCP R2.w, R1.z;\n"
+ "MUL R2.xyz, R0, R2.w;\n"
+ "MUL R5.xyz, -R2, c[8].w;\n"
+ "MAD R4.xyz, -R0, R2.w, c[8].x;\n"
+ "TEX R1.x, R1, texture[2], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MAD R3.xyz, R1, c[8].z, -R1.w;\n"
+ "RSQ R2.x, R2.x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MUL R4.xyz, R4, R3;\n"
+ "ADD R5.xyz, R5, c[9].x;\n"
+ "MUL R5.xyz, R4, R5;\n"
+ "ADD R4.xyz, R1.w, -R4;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R2, R0.w, -R0;\n"
+ "MUL R3.xyz, R2, R3;\n"
+ "ADD R2.xyz, R1.w, -R5;\n"
+ "MAD R5.xyz, R0, R1.w, R3;\n"
+ "MUL R2.xyz, R0, R2;\n"
+ "MUL R3.xyz, R0, c[8].w;\n"
+ "ADD R5.xyz, R5, -R2;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MUL R3.xyz, R3, R5;\n"
+ "ADD R2.xyz, R2, R3;\n"
+ "MUL R3.xyz, R0, R4;\n"
+ "MUL R4.xyz, R1, c[8].z;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MUL R2.xyz, R4, R2;\n"
+ "ADD R2.xyz, R3, R2;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[0];\n"
+ "MUL R1.xy, R1, c[1];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[2];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "MUL R0, fragment.color.primary, R0.x;\n"
+ "ADD R3.xyz, R0, R1;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R0.xyz, R0, R1.w;\n"
+ "MIN R0.xyz, R0, R2;\n"
+ "MAD R2.xyz, -R0, c[8].x, R3;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION =
+ "!!ARBfp1.0\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[4];\n"
+ "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
+ "ADD R0.xyz, R0, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[6];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0.x, R0, texture[2], 2D;\n"
+ "MUL R1.xy, fragment.position, c[7];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0, fragment.color.primary, R0.x;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MAD R3.xyz, R0, R1.w, R2;\n"
+ "MUL R2.xyz, R0, R1;\n"
+ "MAD R2.xyz, -R2, c[8].y, R3;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
+ "MAD R0.xyz, R0, R2.w, R2;\n"
+ "ADD R2.x, -R0.w, c[8];\n"
+ "MAD R2.xyz, R1, R2.x, R0;\n"
+ "ADD R0.z, R0.w, R1.w;\n"
+ "MAD R2.w, -R0, R1, R0.z;\n"
+ "ADD R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, R0, c[1];\n"
+ "TEX R0, R0, texture[1], 2D;\n"
+ "ADD R2, R2, -R1;\n"
+ "DP4 R0.x, R0, c[2];\n"
+ "MAD result.color, R0.x, R2, R1;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 1 },\n"
+ " program.local[6..7] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, c[7].y;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R3.xyz, R2, R1.w;\n"
+ "MUL R2.xyz, R1, c[7].x;\n"
+ "MUL R0.xyz, R0, c[6].z;\n"
+ "MAD R2.xyz, R2, R0.w, R3;\n"
+ "MUL R1.xyz, R1, c[6].y;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[5];\n"
+ "MAD result.color.xyz, R0, R2.x, R1;\n"
+ "ADD R0.y, -R0.w, c[5].x;\n"
+ "MUL R0.x, R1.w, R0.w;\n"
+ "MUL R0.z, R0.w, R2.x;\n"
+ "MUL R0.y, R1.w, R0;\n"
+ "DP3 result.color.w, R0, c[6];\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_MULTIPLY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[3];\n"
+ "MOV R1.y, -R1;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1.x, R1, texture[1], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "ADD R2.x, -R0.w, c[5];\n"
+ "MUL R2.xyz, R1, R2.x;\n"
+ "MAD R1.xyz, R1, R0, R2;\n"
+ "ADD R2.x, R1.w, R0.w;\n"
+ "ADD R2.y, -R1.w, c[5].x;\n"
+ "MAD result.color.xyz, R0, R2.y, R1;\n"
+ "MAD result.color.w, -R1, R0, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[5] = { program.local[0..4] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "ADD R2, R1, R0;\n"
+ "MAD result.color, -R1, R0, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R3.xyz, R1.w, -R1;\n"
+ "ADD R2.xyz, R0.w, -R0;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
+ "MUL R2.xyz, R2, c[5].x;\n"
+ "MAD R2.xyz, R1.w, R0.w, -R2;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "MUL R3.xyz, R1, R2.w;\n"
+ "MUL R1.xyz, R1, R0;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
+ "MAD R1.xyz, R1, c[5].x, R3;\n"
+ "MAD R1.xyz, R0, R2.w, R1;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R0.xyz, R0, c[5].x;\n"
+ "ADD R2.w, R1, R0;\n"
+ "ADD R2.xyz, R2, -R1;\n"
+ "SGE R0.xyz, R0, R0.w;\n"
+ "MAD result.color.xyz, R0, R2, R1;\n"
+ "MAD result.color.w, -R1, R0, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DARKEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0, R1.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, R1.w, R0.w;\n"
+ "ADD R2.y, -R1.w, c[5].x;\n"
+ "MAD result.color.xyz, R0, R2.y, R1;\n"
+ "MAD result.color.w, -R1, R0, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_LIGHTEN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0, R1.w;\n"
+ "MAX R2.xyz, R2, R3;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, R1.w, R0.w;\n"
+ "ADD R2.y, -R1.w, c[5].x;\n"
+ "MAD result.color.xyz, R0, R2.y, R1;\n"
+ "MAD result.color.w, -R1, R0, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORDODGE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 1e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0.x, R0, texture[1], 2D;\n"
+ "MUL R1, fragment.color.primary, R0.x;\n"
+ "MAX R0.x, R1.w, c[5].y;\n"
+ "RCP R0.x, R0.x;\n"
+ "MAD R0.xyz, -R1, R0.x, c[5].x;\n"
+ "MAX R2.xyz, R0, c[5].y;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[5].x;\n"
+ "MUL R3.xyz, R0, R2.w;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MUL R0.xyz, R0, R1.w;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R0, R2, R3;\n"
+ "MAD R0.xyz, R1, R0.w, R0;\n"
+ "MAD R3.xyz, R1.w, R0.w, R3;\n"
+ "MUL R2.w, R1, R0;\n"
+ "ADD R1.x, R1.w, R0.w;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "SGE R0.xyz, R0, R2.w;\n"
+ "MAD result.color.xyz, R0, R3, R2;\n"
+ "MAD result.color.w, -R1, R0, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORBURN_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 9.9999997e-06 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R2.xyz, -R1.w, R0.w, R3;\n"
+ "MUL R4.xyz, R1.w, R2;\n"
+ "MAX R2.xyz, R1, c[5].y;\n"
+ "MUL R5.xyz, R1, R2.w;\n"
+ "ADD R3.w, -R1, c[5].x;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.y, R2.y;\n"
+ "RCP R2.z, R2.z;\n"
+ "MAD R2.xyz, R4, R2, R5;\n"
+ "MUL R4.xyz, R0, R3.w;\n"
+ "MAD R1.xyz, R1, R2.w, R4;\n"
+ "ADD R3.w, -R1, c[5].x;\n"
+ "MAD R0.xyz, R0, R3.w, R2;\n"
+ "MUL R2.x, R1.w, R0.w;\n"
+ "ADD R2.w, R1, R0;\n"
+ "ADD R0.xyz, R0, -R1;\n"
+ "SGE R2.xyz, R3, R2.x;\n"
+ "MAD result.color.xyz, R2, R0, R1;\n"
+ "MAD result.color.w, -R1, R0, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2, 1 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
+ "ADD R3.xyz, R1.w, -R1;\n"
+ "ADD R2.xyz, R0.w, -R0;\n"
+ "MUL R2.xyz, R2, R3;\n"
+ "MUL R2.xyz, R2, c[5].x;\n"
+ "MAD R2.xyz, R1.w, R0.w, -R2;\n"
+ "MUL R4.xyz, R1, R2.w;\n"
+ "MUL R3.xyz, R1, R0;\n"
+ "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
+ "MUL R1.xyz, R1, c[5].x;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MAD R3.xyz, R3, c[5].x, R4;\n"
+ "MAD R0.xyz, R0, R2.w, R3;\n"
+ "ADD R2.w, R1, R0;\n"
+ "ADD R2.xyz, R2, -R0;\n"
+ "SGE R1.xyz, R1, R1.w;\n"
+ "MAD result.color.xyz, R1, R2, R0;\n"
+ "MAD result.color.w, -R1, R0, R2;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..4],\n"
+ " { 1, 9.9999997e-06, 2, 8 },\n"
+ " { 3 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "TEMP R4;\n"
+ "TEMP R5;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R1.xyz, R0, c[2];\n"
+ "RCP R0.z, R1.z;\n"
+ "MUL R1.xy, R1, R0.z;\n"
+ "MUL R1.xy, R1, c[3];\n"
+ "MOV R1.y, -R1;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.z, R0.w, c[5].y;\n"
+ "RCP R2.w, R1.z;\n"
+ "MUL R2.xyz, R0, R2.w;\n"
+ "MUL R5.xyz, -R2, c[5].w;\n"
+ "MAD R4.xyz, -R0, R2.w, c[5].x;\n"
+ "TEX R1.x, R1, texture[1], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MAD R3.xyz, R1, c[5].z, -R1.w;\n"
+ "RSQ R2.x, R2.x;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MUL R4.xyz, R4, R3;\n"
+ "ADD R5.xyz, R5, c[6].x;\n"
+ "MUL R5.xyz, R4, R5;\n"
+ "ADD R4.xyz, R1.w, -R4;\n"
+ "RCP R2.x, R2.x;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R2, R0.w, -R0;\n"
+ "MUL R3.xyz, R2, R3;\n"
+ "ADD R2.xyz, R1.w, -R5;\n"
+ "MAD R5.xyz, R0, R1.w, R3;\n"
+ "MUL R2.xyz, R0, R2;\n"
+ "MUL R3.xyz, R0, c[5].w;\n"
+ "ADD R5.xyz, R5, -R2;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
+ "MUL R3.xyz, R3, R5;\n"
+ "ADD R2.xyz, R2, R3;\n"
+ "MUL R3.xyz, R0, R4;\n"
+ "MUL R4.xyz, R1, c[5].z;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "MUL R2.xyz, R4, R2;\n"
+ "ADD R2.xyz, R3, R2;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, R1.w, R0.w;\n"
+ "ADD R2.y, -R1.w, c[5].x;\n"
+ "MAD result.color.xyz, R0, R2.y, R1;\n"
+ "MAD result.color.w, -R1, R0, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R3.xyz, R0, R1.w;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
+ "ADD R0.xyz, R1, R0;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "ADD R1.x, R1.w, R0.w;\n"
+ "MAD result.color.xyz, -R2, c[5].x, R0;\n"
+ "MAD result.color.w, -R1, R0, R1.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 1, 2 } };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "TEMP R2;\n"
+ "TEMP R3;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R2.xyz, R0, R1.w;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "MUL R2.xyz, R1, R0;\n"
+ "MAD R2.xyz, -R2, c[5].y, R3;\n"
+ "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, R1.w, R0.w;\n"
+ "ADD R2.y, -R1.w, c[5].x;\n"
+ "MAD result.color.xyz, R0, R2.y, R1;\n"
+ "MAD result.color.w, -R1, R0, R2.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_MASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[7] = { program.local[0..6] };\n"
+ "TEMP R0;\n"
+ "TEMP R1;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R1.xyz, R0, c[2];\n"
+ "RCP R0.z, R1.z;\n"
+ "MUL R0.zw, R1.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[3];\n"
+ "MOV R1.y, -R1;\n"
+ "ADD R0.xy, fragment.position, c[4];\n"
+ "MUL R0.xy, R0, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1.x, R1, texture[1], 2D;\n"
+ "DP4 R0.x, R0, c[6];\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL result.color, R1, R0.x;\n"
+ "END\n"
+ ;
+
+static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_NOMASK =
+ "!!ARBfp1.0\n"
+ "PARAM c[4] = { program.local[0..3] };\n"
+ "TEMP R0;\n"
+ "MUL R0.xyz, fragment.position.y, c[1];\n"
+ "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
+ "ADD R0.xyz, R0, c[2];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R0.xy, R0, R0.z;\n"
+ "MUL R0.xy, R0, c[3];\n"
+ "MOV R0.y, -R0;\n"
+ "TEX R0.x, R0, texture[0], 2D;\n"
+ "MUL result.color, fragment.color.primary, R0.x;\n"
+ "END\n"
+ ;
+
+static const char *mask_fragment_program_sources[num_fragment_masks] = {
+ FragmentProgram_FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA,
+ FragmentProgram_FRAGMENT_PROGRAM_MASK_ELLIPSE_AA,
+};
+
+static const char *painter_fragment_program_sources[num_fragment_brushes][num_fragment_composition_modes] = {
+ {
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SIMPLE_PORTER_DUFF,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_MULTIPLY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SCREEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_OVERLAY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DARKEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_LIGHTEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORDODGE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORBURN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_HARDLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DIFFERENCE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_EXCLUSION,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_MULTIPLY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SCREEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_OVERLAY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DARKEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_LIGHTEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORDODGE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORBURN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_HARDLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_DIFFERENCE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_EXCLUSION_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE_BLEND_MODE_MASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE_BLEND_MODE_NOMASK,
+ },
+ {
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_MULTIPLY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SCREEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_OVERLAY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DARKEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_LIGHTEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORDODGE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORBURN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_HARDLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SOFTLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DIFFERENCE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_EXCLUSION,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_MULTIPLY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SCREEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_OVERLAY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DARKEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_LIGHTEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORDODGE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORBURN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_HARDLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DIFFERENCE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_EXCLUSION_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODE_BLEND_MODE_MASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODE_BLEND_MODE_NOMASK,
+ },
+ {
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_MASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_NOMASK,
+ },
+ {
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SIMPLE_PORTER_DUFF,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_MULTIPLY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SCREEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_OVERLAY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DARKEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_LIGHTEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORDODGE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORBURN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_HARDLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DIFFERENCE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_EXCLUSION,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_MULTIPLY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SCREEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_OVERLAY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DARKEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_LIGHTEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORDODGE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORBURN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_HARDLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_DIFFERENCE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_EXCLUSION_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODE_BLEND_MODE_MASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODE_BLEND_MODE_NOMASK,
+ },
+ {
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SIMPLE_PORTER_DUFF,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_MULTIPLY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SCREEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_OVERLAY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DARKEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_LIGHTEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORDODGE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORBURN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_HARDLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DIFFERENCE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_EXCLUSION,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_MULTIPLY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SCREEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_OVERLAY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DARKEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_LIGHTEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORDODGE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORBURN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_HARDLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_DIFFERENCE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_EXCLUSION_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODE_BLEND_MODE_MASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODE_BLEND_MODE_NOMASK,
+ },
+ {
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SIMPLE_PORTER_DUFF,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_MULTIPLY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DARKEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_LIGHTEN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORDODGE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORBURN,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_MULTIPLY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DARKEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_LIGHTEN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORDODGE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORBURN_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION_NOMASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_MASK,
+ FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_NOMASK,
+ },
+};
+
+static int painter_variable_locations[num_fragment_brushes][num_fragment_composition_modes][num_fragment_variables] = {
+ {
+ { -1, -1, -1, 1, -1, 6, 2, -1, 5, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, 3, -1, -1, 2, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 1, -1, -1, 2, -1, -1, -1, 0, -1, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
+ },
+ {
+ { -1, -1, 4, 1, 5, 11, 2, -1, 10, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
+ { -1, -1, 1, -1, 2, 8, -1, -1, 7, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, 7, 2, -1, 8, -1, -1, -1, 0, -1, 1, 6, -1, 5, 3, 0, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 5, 3, 0, -1, },
+ },
+ {
+ { -1, -1, 4, 1, 5, 12, 2, -1, 11, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
+ { -1, -1, 1, -1, 2, 9, -1, -1, 8, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, 8, 2, -1, 9, -1, -1, -1, 0, -1, 1, 7, -1, -1, -1, 0, 5, },
+ { -1, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, 5, },
+ },
+ {
+ { -1, 6, 4, 1, 5, 10, 2, -1, 9, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
+ { -1, 3, 1, -1, 2, 7, -1, -1, 6, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, 5, 2, -1, 6, -1, -1, -1, 0, -1, 1, 4, -1, -1, -1, 0, -1, },
+ { -1, 3, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, -1, },
+ },
+ {
+ { 2, -1, 4, 1, 5, 10, 2, -1, 9, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 1, -1, 1, -1, 2, 7, -1, -1, 6, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, 5, 2, -1, 6, -1, -1, -1, 0, -1, -1, 4, 3, -1, -1, 0, -1, },
+ { 0, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, 0, -1, },
+ },
+ {
+ { 2, -1, 4, 1, 5, 10, 2, -1, 9, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
+ { 1, -1, 1, -1, 2, 7, -1, -1, 6, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
+ { 1, -1, 1, 5, 2, -1, 6, -1, -1, -1, 0, -1, -1, 4, 3, -1, -1, 0, -1, },
+ { 0, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, 0, -1, },
+ },
+};
+
+static int mask_variable_locations[num_fragment_masks][num_fragment_variables] = {
+ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, 2, -1, 3, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, },
+};
+
+#endif
diff --git a/src/opengl/util/generator.cpp b/src/opengl/util/generator.cpp
new file mode 100644
index 0000000..de2450d
--- /dev/null
+++ b/src/opengl/util/generator.cpp
@@ -0,0 +1,435 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtOpenGL module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QFile>
+#include <QList>
+#include <QMap>
+#include <QPair>
+#include <QSet>
+#include <QString>
+#include <QTextStream>
+
+#include <QtDebug>
+
+QT_BEGIN_NAMESPACE
+
+QT_USE_NAMESPACE
+
+typedef QPair<QString, QString> QStringPair;
+
+QString readSourceFile(const QString &sourceFile, bool fragmentProgram = false)
+{
+ QFile file(sourceFile);
+
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qDebug() << "Missing source file" << sourceFile;
+ exit(0);
+ }
+
+ QString source;
+
+ QTextStream in(&file);
+ while (!in.atEnd()) {
+ QString line = in.readLine();
+
+ if (fragmentProgram && line[0] == '#' && !line.startsWith("#var"))
+ continue;
+
+ if (fragmentProgram)
+ source.append(" \"");
+
+ source.append(line);
+
+ if (fragmentProgram)
+ source.append("\\n\"");
+
+ source.append('\n');
+ }
+
+ if (fragmentProgram)
+ source.append(" ;\n");
+
+ return source;
+}
+
+QList<QStringPair> readConf(const QString &confFile)
+{
+ QFile file(confFile);
+
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qDebug() << "Missing file" << confFile;
+ exit(0);
+ }
+
+ QList<QStringPair> result;
+
+ QTextStream in(&file);
+ while (!in.atEnd()) {
+ QString line = in.readLine();
+
+ if (line.startsWith('#'))
+ continue;
+
+ QTextStream lineStream(&line);
+
+ QString enumerator;
+ QString sourceFile;
+
+ lineStream >> enumerator;
+
+ if (lineStream.atEnd()) {
+ qDebug() << "Error in file" << confFile << "(" << enumerator << ")";
+ exit(0);
+ }
+
+ lineStream >> sourceFile;
+
+ result << QStringPair(enumerator, readSourceFile(sourceFile));
+ }
+
+ return result;
+}
+
+QString compileSource(const QString &source)
+{
+ {
+ QFile tempSourceFile("__tmp__.glsl");
+ if (!tempSourceFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ qDebug() << "Failed opening __tmp__.glsl";
+ exit(0);
+ }
+
+ QTextStream out(&tempSourceFile);
+ out << source;
+ }
+
+ if (std::system("cgc -quiet -oglsl -profile arbfp1 __tmp__.glsl >__tmp__.frag") == -1) {
+ qDebug() << "Failed running cgc";
+ exit(0);
+ }
+
+ return readSourceFile("__tmp__.frag", true);
+}
+
+QString getWord(QString line, int word)
+{
+ QTextStream in(&line);
+
+ QString result;
+
+ for (int i = 0; i < word; ++i)
+ in >> result;
+
+ return result;
+}
+
+static int toInt(const QByteArray &str)
+{
+ int value = 0;
+
+ for (int i = 0; i < str.size(); ++i) {
+ if (str[i] < '0' || str[i] > '9')
+ break;
+
+ value *= 10;
+ value += (str[i] - '0');
+ }
+
+ return value;
+}
+QList<int> getLocations(const QSet<QString> &variables, QString source)
+{
+ QTextStream in(&source);
+
+ QMap<QString, int> locations;
+
+ foreach (QString variable, variables)
+ locations[variable] = -1;
+
+ while (!in.atEnd()) {
+ QString line = in.readLine().trimmed();
+
+ line = line.right(line.size() - 1);
+
+ if (line.startsWith("#var")) {
+ QByteArray temp;
+ QByteArray name;
+
+ QTextStream lineStream(&line);
+
+ lineStream >> temp >> temp >> name;
+
+ int location = -1;
+
+ while (!lineStream.atEnd()) {
+ lineStream >> temp;
+
+ if (temp.startsWith("c[")) {
+ location = toInt(temp.right(temp.size() - 2));
+ break;
+ }
+
+ if (temp == "texunit") {
+ lineStream >> temp;
+ location = toInt(temp);
+ break;
+ }
+ }
+
+ locations[name] = location;
+ }
+ }
+
+ QList<int> result;
+
+ foreach (QString variable, variables)
+ result << locations[variable];
+
+ return result;
+}
+
+// remove #var statements
+QString trimmed(QString source)
+{
+ QTextStream in(&source);
+
+ QString result;
+
+ while (!in.atEnd()) {
+ QString line = in.readLine();
+ if (!line.trimmed().startsWith("\"#"))
+ result += line + '\n';
+ }
+
+ return result;
+}
+
+void writeIncludeFile(const QSet<QString> &variables,
+ const QList<QStringPair> &brushes,
+ const QList<QStringPair> &compositionModes,
+ const QList<QStringPair> &masks,
+ const QMap<QString, QMap<QString, QString> > &compiled)
+{
+ QFile includeFile("fragmentprograms_p.h");
+ if (!includeFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ qDebug() << "Failed opening fragmentprograms_p.h";
+ exit(0);
+ }
+
+ QTextStream out(&includeFile);
+
+ QLatin1String tab(" ");
+
+ out << "#ifndef FRAGMENTPROGRAMS_H\n"
+ << "#define FRAGMENTPROGRAMS_H\n\n";
+
+ out << "enum FragmentVariable {\n";
+ foreach (QString str, variables)
+ out << tab << "VAR_" << str.toUpper() << ",\n";
+ out << "};\n\n";
+
+ out << "enum FragmentBrushType {\n";
+ foreach (QStringPair brush, brushes)
+ out << tab << brush.first << ",\n";
+ out << "};\n\n";
+
+ out << "enum FragmentCompositionModeType {\n";
+ foreach (QStringPair mode, compositionModes)
+ out << tab << mode.first << ",\n";
+ out << "};\n\n";
+
+ out << "enum FragmentMaskType {\n";
+ foreach (QStringPair mask, masks)
+ out << tab << mask.first << ",\n";
+ out << "};\n\n";
+
+ out << "static const unsigned int num_fragment_variables = " << variables.size() << ";\n\n";
+ out << "static const unsigned int num_fragment_brushes = " << brushes.size() << ";\n";
+ out << "static const unsigned int num_fragment_composition_modes = " << compositionModes.size() << ";\n";
+ out << "static const unsigned int num_fragment_masks = " << masks.size() << ";\n\n";
+
+ foreach (QStringPair mask, masks) {
+ const QString compiledSource = compiled[mask.first]["MASK__"];
+
+ out << "static const char *FragmentProgram_" << mask.first << " =\n"
+ << trimmed(compiledSource)
+ << '\n';
+ }
+
+ foreach (QStringPair brush, brushes) {
+ foreach (QStringPair mode, compositionModes) {
+ const QString compiledSource = compiled[brush.first][mode.first];
+
+ out << "static const char *FragmentProgram_" << brush.first << '_' << mode.first << " =\n"
+ << trimmed(compiledSource)
+ << '\n';
+ }
+ }
+
+ out << "static const char *mask_fragment_program_sources[num_fragment_masks] = {\n";
+ foreach (QStringPair mask, masks)
+ out << tab << "FragmentProgram_" << mask.first << ",\n";
+ out << "};\n\n";
+
+ out << "static const char *painter_fragment_program_sources[num_fragment_brushes][num_fragment_composition_modes] = {\n";
+ foreach (QStringPair brush, brushes) {
+ out << tab << "{\n";
+
+ foreach (QStringPair mode, compositionModes)
+ out << tab << tab << "FragmentProgram_" << brush.first << '_' << mode.first << ",\n";
+
+ out << tab << "},\n";
+ }
+ out << "};\n\n";
+
+ out << "static int painter_variable_locations[num_fragment_brushes][num_fragment_composition_modes][num_fragment_variables] = {\n";
+ foreach (QStringPair brush, brushes) {
+ out << tab << "{\n";
+
+ foreach (QStringPair mode, compositionModes) {
+ out << tab << tab << "{ ";
+
+ QList<int> locations = getLocations(variables, compiled[brush.first][mode.first]);
+
+ foreach (int location, locations)
+ out << location << ", ";
+
+ out << "},\n";
+ }
+
+ out << tab << "},\n";
+ }
+ out << "};\n\n";
+
+ out << "static int mask_variable_locations[num_fragment_masks][num_fragment_variables] = {\n";
+ foreach (QStringPair mask, masks) {
+ out << tab << "{ ";
+
+ QList<int> locations = getLocations(variables, compiled[mask.first]["MASK__"]);
+
+ foreach (int location, locations)
+ out << location << ", ";
+
+ out << "},\n";
+ }
+ out << "};\n\n";
+ out << "#endif\n";
+}
+
+QList<QString> getVariables(QString program)
+{
+ QList<QString> result;
+
+ QTextStream in(&program);
+ while (!in.atEnd()) {
+ QString line = in.readLine();
+
+ if (line.startsWith("uniform")) {
+ QString word = getWord(line, 3);
+ result << word.left(word.size() - 1);
+ } else if (line.startsWith("#include")) {
+ QString file = getWord(line, 2);
+ result << getVariables(readSourceFile(file.mid(1, file.size() - 2)));
+ }
+ }
+
+ return result;
+}
+
+int main()
+{
+ QList<QStringPair> brushes = readConf(QLatin1String("brushes.conf"));
+ QList<QStringPair> compositionModes = readConf(QLatin1String("composition_modes.conf"));
+ QList<QStringPair> masks = readConf(QLatin1String("masks.conf"));
+
+ QString painterSource = readSourceFile("painter.glsl");
+ QString painterNoMaskSource = readSourceFile("painter_nomask.glsl");
+ QString fastPainterSource = readSourceFile("fast_painter.glsl");
+ QString brushPainterSource = readSourceFile("brush_painter.glsl");
+
+ QSet<QString> variables;
+
+ QList<QStringPair> programs[3] = { brushes, compositionModes, masks };
+
+ for (int i = 0; i < 3; ++i)
+ foreach (QStringPair value, programs[i])
+ variables += QSet<QString>::fromList(getVariables(value.second));
+
+ variables += QSet<QString>::fromList(getVariables(painterSource));
+ variables += QSet<QString>::fromList(getVariables(fastPainterSource));
+
+ QMap<QString, QMap<QString, QString> > compiled;
+
+ foreach (QStringPair brush, brushes) {
+ foreach (QStringPair mode, compositionModes) {
+ QString combinedSource = brush.second + mode.second + painterSource;
+ compiled[brush.first][mode.first] = compileSource(combinedSource);
+
+ combinedSource = brush.second + mode.second + painterNoMaskSource;
+ compiled[brush.first][mode.first + "_NOMASK"] = compileSource(combinedSource);
+ }
+
+ QString fastSource = brush.second + fastPainterSource;
+ QString brushSource = brush.second + brushPainterSource;
+
+ compiled[brush.first]["COMPOSITION_MODE_BLEND_MODE_MASK"] = compileSource(fastSource);
+ compiled[brush.first]["COMPOSITION_MODE_BLEND_MODE_NOMASK"] = compileSource(brushSource);
+ }
+
+ QList<QStringPair> temp;
+
+ foreach (QStringPair mode, compositionModes)
+ temp << QStringPair(mode.first + "_NOMASK", mode.second);
+
+ compositionModes += temp;
+
+ compositionModes << QStringPair("COMPOSITION_MODE_BLEND_MODE_MASK", "")
+ << QStringPair("COMPOSITION_MODE_BLEND_MODE_NOMASK", "");
+
+ foreach (QStringPair mask, masks)
+ compiled[mask.first]["MASK__"] = compileSource(mask.second);
+
+ writeIncludeFile(variables, brushes, compositionModes, masks, compiled);
+
+ return 0;
+}
+
+QT_END_NAMESPACE
diff --git a/src/opengl/util/generator.pro b/src/opengl/util/generator.pro
new file mode 100644
index 0000000..9425dbe
--- /dev/null
+++ b/src/opengl/util/generator.pro
@@ -0,0 +1,11 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Thu Oct 19 11:03:24 2006
+######################################################################
+
+TEMPLATE = app
+TARGET = generator
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += generator.cpp
diff --git a/src/opengl/util/glsl_to_include.sh b/src/opengl/util/glsl_to_include.sh
new file mode 100755
index 0000000..59d4693
--- /dev/null
+++ b/src/opengl/util/glsl_to_include.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+# Compile a .glsl file to a file that can be included in a C++ program
+USAGE="Usage: $0 <file.glsl>"
+CGC=cgc
+CGC_PROFILE=arbfp1
+
+if test $# -ne 1
+then
+ echo $USAGE
+ exit 1
+fi
+
+GLSL_FILE=$1
+FRAG_FILE=`basename $1 .glsl`.frag
+#GLSL_INC_FILE=`basename $1 .glsl`.glsl_quoted
+
+echo "// Generated by src/opengl/util/$0 from $1" > $FRAG_FILE
+$CGC -quiet -oglsl -profile $CGC_PROFILE $GLSL_FILE | while read line
+do
+ if test `echo $line | cut -c1` != "#"
+ then
+ echo -e \"$line\" >> $FRAG_FILE
+ fi
+done
+echo "; // Generated by src/opengl/util/$0 from $1" >> $FRAG_FILE
+
+#echo "// Generated by src/opengl/util/$0 from $1" > $GLSL_INC_FILE
+#cat $GLSL_FILE | while read line
+#do
+# printf \"%s\\\\n\"\\n "$line" >> $GLSL_INC_FILE
+#done
+#echo "; // Generated by src/opengl/util/$0 from $1" >> $GLSL_INC_FILE
diff --git a/src/opengl/util/linear_brush.glsl b/src/opengl/util/linear_brush.glsl
new file mode 100644
index 0000000..90a4440
--- /dev/null
+++ b/src/opengl/util/linear_brush.glsl
@@ -0,0 +1,22 @@
+uniform sampler1D palette;
+uniform vec3 linear;
+uniform vec3 inv_matrix_m0;
+uniform vec3 inv_matrix_m1;
+uniform vec3 inv_matrix_m2;
+
+vec4 brush()
+{
+ mat3 mat;
+
+ mat[0] = inv_matrix_m0;
+ mat[1] = inv_matrix_m1;
+ mat[2] = inv_matrix_m2;
+
+ vec3 hcoords = mat * vec3(gl_FragCoord.xy, 1);
+ vec2 A = hcoords.xy / hcoords.z;
+
+ float val = dot(linear.xy, A) * linear.z;
+
+ return texture1D(palette, val);
+}
+
diff --git a/src/opengl/util/masks.conf b/src/opengl/util/masks.conf
new file mode 100644
index 0000000..733ac81
--- /dev/null
+++ b/src/opengl/util/masks.conf
@@ -0,0 +1,3 @@
+FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA trap_exact_aa.glsl
+FRAGMENT_PROGRAM_MASK_ELLIPSE_AA ellipse_aa.glsl
+#FRAGMENT_PROGRAM_MASK_ELLIPSE ellipse.glsl
diff --git a/src/opengl/util/painter.glsl b/src/opengl/util/painter.glsl
new file mode 100644
index 0000000..b990234
--- /dev/null
+++ b/src/opengl/util/painter.glsl
@@ -0,0 +1,21 @@
+uniform sampler2D dst_texture;
+uniform sampler2D mask_texture;
+uniform vec2 inv_mask_size;
+uniform vec2 inv_dst_size;
+uniform vec2 mask_offset;
+uniform vec4 mask_channel;
+
+float mask()
+{
+ return dot(mask_channel, texture2D(mask_texture, (gl_FragCoord.xy + mask_offset) * inv_mask_size));
+}
+
+void main()
+{
+ vec4 dst = texture2D(dst_texture, gl_FragCoord.xy * inv_dst_size);
+
+ // combine clip and coverage channels
+ float mask_alpha = mask();
+
+ gl_FragColor = mix(dst, composite(brush(), dst), mask_alpha);
+}
diff --git a/src/opengl/util/painter_nomask.glsl b/src/opengl/util/painter_nomask.glsl
new file mode 100644
index 0000000..af5ad65
--- /dev/null
+++ b/src/opengl/util/painter_nomask.glsl
@@ -0,0 +1,9 @@
+uniform sampler2D dst_texture;
+uniform vec2 inv_dst_size;
+
+void main()
+{
+ vec4 dst = texture2D(dst_texture, gl_FragCoord.xy * inv_dst_size);
+
+ gl_FragColor = composite(brush(), dst);
+}
diff --git a/src/opengl/util/pattern_brush.glsl b/src/opengl/util/pattern_brush.glsl
new file mode 100644
index 0000000..e070449
--- /dev/null
+++ b/src/opengl/util/pattern_brush.glsl
@@ -0,0 +1,25 @@
+uniform sampler2D brush_texture;
+uniform vec2 inv_brush_texture_size;
+uniform vec3 inv_matrix_m0;
+uniform vec3 inv_matrix_m1;
+uniform vec3 inv_matrix_m2;
+
+vec4 brush()
+{
+ mat3 mat;
+
+ mat[0] = inv_matrix_m0;
+ mat[1] = inv_matrix_m1;
+ mat[2] = inv_matrix_m2;
+
+ vec3 hcoords = mat * vec3(gl_FragCoord.xy, 1);
+ vec2 coords = hcoords.xy / hcoords.z;
+
+ coords *= inv_brush_texture_size;
+
+ coords.y = -coords.y;
+
+ float alpha = texture2D(brush_texture, coords).r;
+
+ return gl_Color * alpha;
+}
diff --git a/src/opengl/util/radial_brush.glsl b/src/opengl/util/radial_brush.glsl
new file mode 100644
index 0000000..84bec62
--- /dev/null
+++ b/src/opengl/util/radial_brush.glsl
@@ -0,0 +1,28 @@
+uniform sampler1D palette;
+uniform vec2 fmp;
+uniform float fmp2_m_radius2;
+uniform vec3 inv_matrix_m0;
+uniform vec3 inv_matrix_m1;
+uniform vec3 inv_matrix_m2;
+
+vec4 brush()
+{
+ mat3 mat;
+
+ mat[0] = inv_matrix_m0;
+ mat[1] = inv_matrix_m1;
+ mat[2] = inv_matrix_m2;
+
+ vec3 hcoords = mat * vec3(gl_FragCoord.xy, 1);
+ vec2 A = hcoords.xy / hcoords.z;
+ vec2 B = fmp;
+
+ float a = fmp2_m_radius2;
+ float b = 2.0*dot(A, B);
+ float c = -dot(A, A);
+
+ float val = (-b + sqrt(b*b - 4.0*a*c)) / (2.0*a);
+
+ return texture1D(palette, val);
+}
+
diff --git a/src/opengl/util/simple_porter_duff.glsl b/src/opengl/util/simple_porter_duff.glsl
new file mode 100644
index 0000000..83aef48
--- /dev/null
+++ b/src/opengl/util/simple_porter_duff.glsl
@@ -0,0 +1,16 @@
+uniform vec2 porterduff_ab;
+uniform vec3 porterduff_xyz;
+
+vec4 composite(vec4 src, vec4 dst)
+{
+ vec4 result;
+
+ result.xyz = porterduff_ab.x * src.xyz * dst.a
+ + porterduff_ab.y * dst.xyz * src.a
+ + porterduff_xyz.y * src.xyz * (1 - dst.a)
+ + porterduff_xyz.z * dst.xyz * (1 - src.a);
+
+ result.a = dot(porterduff_xyz, vec3(src.a * dst.a, src.a * (1 - dst.a), dst.a * (1 - src.a)));
+
+ return result;
+}
diff --git a/src/opengl/util/solid_brush.glsl b/src/opengl/util/solid_brush.glsl
new file mode 100644
index 0000000..760afd1
--- /dev/null
+++ b/src/opengl/util/solid_brush.glsl
@@ -0,0 +1,4 @@
+vec4 brush()
+{
+ return gl_Color;
+}
diff --git a/src/opengl/util/texture_brush.glsl b/src/opengl/util/texture_brush.glsl
new file mode 100644
index 0000000..93865b8
--- /dev/null
+++ b/src/opengl/util/texture_brush.glsl
@@ -0,0 +1,23 @@
+uniform sampler2D brush_texture;
+uniform vec2 inv_brush_texture_size;
+uniform vec3 inv_matrix_m0;
+uniform vec3 inv_matrix_m1;
+uniform vec3 inv_matrix_m2;
+
+vec4 brush()
+{
+ mat3 mat;
+
+ mat[0] = inv_matrix_m0;
+ mat[1] = inv_matrix_m1;
+ mat[2] = inv_matrix_m2;
+
+ vec3 hcoords = mat * vec3(gl_FragCoord.xy, 1);
+ vec2 coords = hcoords.xy / hcoords.z;
+
+ coords *= inv_brush_texture_size;
+
+ coords.y = -coords.y;
+
+ return texture2D(brush_texture, coords);
+}
diff --git a/src/opengl/util/trap_exact_aa.glsl b/src/opengl/util/trap_exact_aa.glsl
new file mode 100644
index 0000000..b96f87d
--- /dev/null
+++ b/src/opengl/util/trap_exact_aa.glsl
@@ -0,0 +1,58 @@
+float quad_aa()
+{
+ float top = min(gl_FragCoord.y + 0.5, gl_TexCoord[0].x);
+ float bottom = max(gl_FragCoord.y - 0.5, gl_TexCoord[0].y);
+
+ float area = top - bottom;
+
+ float left = gl_FragCoord.x - 0.5;
+ float right = gl_FragCoord.x + 0.5;
+
+ // use line equations to compute intersections of left/right edges with top/bottom of truncated pixel
+ vec4 vecX = gl_TexCoord[1].xxzz * vec2(top, bottom).xyxy + gl_TexCoord[1].yyww;
+
+ vec2 invA = gl_TexCoord[0].zw;
+
+ // transform right line to left to be able to use same calculations for both
+ vecX.zw = 2 * gl_FragCoord.x - vecX.zw;
+
+ vec2 topX = vec2(vecX.x, vecX.z);
+ vec2 bottomX = vec2(vecX.y, vecX.w);
+
+ // transform lines such that top intersection is to the right of bottom intersection
+ vec2 topXTemp = max(topX, bottomX);
+ vec2 bottomXTemp = min(topX, bottomX);
+
+ // make sure line slope reflects mirrored lines
+ invA = mix(invA, -invA, step(topX, bottomX));
+
+ vec2 vecLeftRight = vec2(left, right);
+
+ // compute the intersections of the lines with the left and right edges of the pixel
+ vec4 intersectY = bottom + (vecLeftRight.xyxy - bottomXTemp.xxyy) * invA.xxyy;
+
+ vec2 temp = mix(area - 0.5 * (right - bottomXTemp) * (intersectY.yw - bottom), // left < bottom < right < top
+ (0.5 * (topXTemp + bottomXTemp) - left) * area, // left < bottom < top < right
+ step(topXTemp, right));
+
+ vec2 excluded = 0.5 * (top - intersectY.xz) * (topXTemp - left); // bottom < left < top < right
+
+ excluded = mix((top - 0.5 * (intersectY.yw + intersectY.xz)) * (right - left), // bottom < left < right < top
+ excluded, step(topXTemp, right));
+
+ excluded = mix(temp, // left < bottom < right (see calculation of temp)
+ excluded, step(bottomXTemp, left));
+
+ excluded = mix(vec2(area, area), // right < bottom < top
+ excluded, step(bottomXTemp, right));
+
+ excluded *= step(left, topXTemp);
+
+ return (area - excluded.x - excluded.y) * step(bottom, top);
+}
+
+void main()
+{
+ gl_FragColor = quad_aa();
+}
+