summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin
diff options
context:
space:
mode:
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag93
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag129
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag165
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt2
14 files changed, 778 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html
new file mode 100644
index 0000000000..4d3ebe11db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: asin_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_float_frag_xvary.frag"
+ },
+ "name": "asin_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec2_frag_xvary.frag"
+ },
+ "name": "asin_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec3_frag_xvary.frag"
+ },
+ "name": "asin_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "asin_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "asin_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "asin_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "asin_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "asin_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "asin_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "asin_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "asin_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "asin_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag
new file mode 100644
index 0000000000..1c9cf4fe29
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(asin(c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..92c81ec5f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag
@@ -0,0 +1,93 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_float_frag_xvary_ref.frag
+ * GL/asin/asin_float_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (color.r - 0.5);
+
+ float arrVal = (c + 1.0) * 8.0;
+ int arr0 = int(floor(arrVal));
+ float weight = arrVal - floor(arrVal);
+ float asin_c = 0.0;
+
+ if (arr0 == 0)
+ asin_c = lerp(asinValues[0], asinValues[1], weight);
+ else if (arr0 == 1)
+ asin_c = lerp(asinValues[1], asinValues[2], weight);
+ else if (arr0 == 2)
+ asin_c = lerp(asinValues[2], asinValues[3], weight);
+ else if (arr0 == 3)
+ asin_c = lerp(asinValues[3], asinValues[4], weight);
+ else if (arr0 == 4)
+ asin_c = lerp(asinValues[4], asinValues[5], weight);
+ else if (arr0 == 5)
+ asin_c = lerp(asinValues[5], asinValues[6], weight);
+ else if (arr0 == 6)
+ asin_c = lerp(asinValues[6], asinValues[7], weight);
+ else if (arr0 == 7)
+ asin_c = lerp(asinValues[7], asinValues[8], weight);
+ else if (arr0 == 8)
+ asin_c = lerp(asinValues[8], asinValues[9], weight);
+ else if (arr0 == 9)
+ asin_c = lerp(asinValues[9], asinValues[10], weight);
+ else if (arr0 == 10)
+ asin_c = lerp(asinValues[10], asinValues[11], weight);
+ else if (arr0 == 11)
+ asin_c = lerp(asinValues[11], asinValues[12], weight);
+ else if (arr0 == 12)
+ asin_c = lerp(asinValues[12], asinValues[13], weight);
+ else if (arr0 == 13)
+ asin_c = lerp(asinValues[13], asinValues[14], weight);
+ else if (arr0 == 14)
+ asin_c = lerp(asinValues[14], asinValues[15], weight);
+ else if (arr0 == 15)
+ asin_c = lerp(asinValues[15], asinValues[16], weight);
+ else if (arr0 == 16)
+ asin_c = asinValues[16];
+
+ gl_FragColor = vec4(asin_c / M_PI + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert
new file mode 100644
index 0000000000..f2d55ea2e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(asin(c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..18826e3e96
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert
@@ -0,0 +1,40 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (gtf_Color.r - 0.5);
+
+ float asin_c = 0.0;
+ float scale = 1.0;
+ float sign = 1.0;
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c < 0.0)
+ {
+ sign = -1.0;
+ c *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c += scale * pow(c, float(i)) / float(i);
+ scale *= float(i) / float(i + 1);
+ }
+
+ color = vec4(sign * asin_c / M_PI + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..0b70bfb337
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(asin(c) / M_PI + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..97d0b539d8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag
@@ -0,0 +1,129 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_vec2_frag_xvary_ref.frag
+ * GL/asin/asin_vec2_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (color.rg - 0.5);
+
+ vec2 arrVal = (c + vec2(1.0, 1.0)) * 8.0;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ vec2 weight = arrVal - floor(arrVal);
+ vec2 asin_c = vec2(0.0);
+
+ if (arr0x == 0)
+ asin_c.x = lerp(asinValues[0], asinValues[1], weight.x);
+ else if (arr0x == 1)
+ asin_c.x = lerp(asinValues[1], asinValues[2], weight.x);
+ else if (arr0x == 2)
+ asin_c.x = lerp(asinValues[2], asinValues[3], weight.x);
+ else if (arr0x == 3)
+ asin_c.x = lerp(asinValues[3], asinValues[4], weight.x);
+ else if (arr0x == 4)
+ asin_c.x = lerp(asinValues[4], asinValues[5], weight.x);
+ else if (arr0x == 5)
+ asin_c.x = lerp(asinValues[5], asinValues[6], weight.x);
+ else if (arr0x == 6)
+ asin_c.x = lerp(asinValues[6], asinValues[7], weight.x);
+ else if (arr0x == 7)
+ asin_c.x = lerp(asinValues[7], asinValues[8], weight.x);
+ else if (arr0x == 8)
+ asin_c.x = lerp(asinValues[8], asinValues[9], weight.x);
+ else if (arr0x == 9)
+ asin_c.x = lerp(asinValues[9], asinValues[10], weight.x);
+ else if (arr0x == 10)
+ asin_c.x = lerp(asinValues[10], asinValues[11], weight.x);
+ else if (arr0x == 11)
+ asin_c.x = lerp(asinValues[11], asinValues[12], weight.x);
+ else if (arr0x == 12)
+ asin_c.x = lerp(asinValues[12], asinValues[13], weight.x);
+ else if (arr0x == 13)
+ asin_c.x = lerp(asinValues[13], asinValues[14], weight.x);
+ else if (arr0x == 14)
+ asin_c.x = lerp(asinValues[14], asinValues[15], weight.x);
+ else if (arr0x == 15)
+ asin_c.x = lerp(asinValues[15], asinValues[16], weight.x);
+ else if (arr0x == 16)
+ asin_c.x = asinValues[16];
+
+ if (arr0y == 0)
+ asin_c.y = lerp(asinValues[0], asinValues[1], weight.y);
+ else if (arr0y == 1)
+ asin_c.y = lerp(asinValues[1], asinValues[2], weight.y);
+ else if (arr0y == 2)
+ asin_c.y = lerp(asinValues[2], asinValues[3], weight.y);
+ else if (arr0y == 3)
+ asin_c.y = lerp(asinValues[3], asinValues[4], weight.y);
+ else if (arr0y == 4)
+ asin_c.y = lerp(asinValues[4], asinValues[5], weight.y);
+ else if (arr0y == 5)
+ asin_c.y = lerp(asinValues[5], asinValues[6], weight.y);
+ else if (arr0y == 6)
+ asin_c.y = lerp(asinValues[6], asinValues[7], weight.y);
+ else if (arr0y == 7)
+ asin_c.y = lerp(asinValues[7], asinValues[8], weight.y);
+ else if (arr0y == 8)
+ asin_c.y = lerp(asinValues[8], asinValues[9], weight.y);
+ else if (arr0y == 9)
+ asin_c.y = lerp(asinValues[9], asinValues[10], weight.y);
+ else if (arr0y == 10)
+ asin_c.y = lerp(asinValues[10], asinValues[11], weight.y);
+ else if (arr0y == 11)
+ asin_c.y = lerp(asinValues[11], asinValues[12], weight.y);
+ else if (arr0y == 12)
+ asin_c.y = lerp(asinValues[12], asinValues[13], weight.y);
+ else if (arr0y == 13)
+ asin_c.y = lerp(asinValues[13], asinValues[14], weight.y);
+ else if (arr0y == 14)
+ asin_c.y = lerp(asinValues[14], asinValues[15], weight.y);
+ else if (arr0y == 15)
+ asin_c.y = lerp(asinValues[15], asinValues[16], weight.y);
+ else if (arr0y == 16)
+ asin_c.y = asinValues[16];
+
+ gl_FragColor = vec4(asin_c / M_PI + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..a253bd14ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(asin(c) / M_PI + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..1ed1d47f66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert
@@ -0,0 +1,54 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ vec2 asin_c = vec2(0.0);
+ vec2 scale = vec2(1.0);
+ vec2 sign = vec2(1.0);
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.r < 0.0)
+ {
+ sign.r = -1.0;
+ c.r *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.r += scale.r * pow(c.r, float(i)) / float(i);
+ scale.r *= float(i) / float(i + 1);
+ }
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.g < 0.0)
+ {
+ sign.g = -1.0;
+ c.g *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.g += scale.g * pow(c.g, float(i)) / float(i);
+ scale.g *= float(i) / float(i + 1);
+ }
+
+ color = vec4(sign * asin_c / M_PI + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..d11988539e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(asin(c) / M_PI + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..2d21f0c547
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag
@@ -0,0 +1,165 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_vec3_frag_xvary_ref.frag
+ * GL/asin/asin_vec3_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (color.rgb - 0.5);
+
+ vec3 arrVal = (c + vec3(1.0, 1.0, 1.0)) * 8.0;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ int arr0z = int(floor(arrVal.z));
+ vec3 weight = arrVal - floor(arrVal);
+ vec3 asin_c = vec3(0.0);
+
+ if (arr0x == 0)
+ asin_c.x = lerp(asinValues[0], asinValues[1], weight.x);
+ else if (arr0x == 1)
+ asin_c.x = lerp(asinValues[1], asinValues[2], weight.x);
+ else if (arr0x == 2)
+ asin_c.x = lerp(asinValues[2], asinValues[3], weight.x);
+ else if (arr0x == 3)
+ asin_c.x = lerp(asinValues[3], asinValues[4], weight.x);
+ else if (arr0x == 4)
+ asin_c.x = lerp(asinValues[4], asinValues[5], weight.x);
+ else if (arr0x == 5)
+ asin_c.x = lerp(asinValues[5], asinValues[6], weight.x);
+ else if (arr0x == 6)
+ asin_c.x = lerp(asinValues[6], asinValues[7], weight.x);
+ else if (arr0x == 7)
+ asin_c.x = lerp(asinValues[7], asinValues[8], weight.x);
+ else if (arr0x == 8)
+ asin_c.x = lerp(asinValues[8], asinValues[9], weight.x);
+ else if (arr0x == 9)
+ asin_c.x = lerp(asinValues[9], asinValues[10], weight.x);
+ else if (arr0x == 10)
+ asin_c.x = lerp(asinValues[10], asinValues[11], weight.x);
+ else if (arr0x == 11)
+ asin_c.x = lerp(asinValues[11], asinValues[12], weight.x);
+ else if (arr0x == 12)
+ asin_c.x = lerp(asinValues[12], asinValues[13], weight.x);
+ else if (arr0x == 13)
+ asin_c.x = lerp(asinValues[13], asinValues[14], weight.x);
+ else if (arr0x == 14)
+ asin_c.x = lerp(asinValues[14], asinValues[15], weight.x);
+ else if (arr0x == 15)
+ asin_c.x = lerp(asinValues[15], asinValues[16], weight.x);
+ else if (arr0x == 16)
+ asin_c.x = asinValues[16];
+
+ if (arr0y == 0)
+ asin_c.y = lerp(asinValues[0], asinValues[1], weight.y);
+ else if (arr0y == 1)
+ asin_c.y = lerp(asinValues[1], asinValues[2], weight.y);
+ else if (arr0y == 2)
+ asin_c.y = lerp(asinValues[2], asinValues[3], weight.y);
+ else if (arr0y == 3)
+ asin_c.y = lerp(asinValues[3], asinValues[4], weight.y);
+ else if (arr0y == 4)
+ asin_c.y = lerp(asinValues[4], asinValues[5], weight.y);
+ else if (arr0y == 5)
+ asin_c.y = lerp(asinValues[5], asinValues[6], weight.y);
+ else if (arr0y == 6)
+ asin_c.y = lerp(asinValues[6], asinValues[7], weight.y);
+ else if (arr0y == 7)
+ asin_c.y = lerp(asinValues[7], asinValues[8], weight.y);
+ else if (arr0y == 8)
+ asin_c.y = lerp(asinValues[8], asinValues[9], weight.y);
+ else if (arr0y == 9)
+ asin_c.y = lerp(asinValues[9], asinValues[10], weight.y);
+ else if (arr0y == 10)
+ asin_c.y = lerp(asinValues[10], asinValues[11], weight.y);
+ else if (arr0y == 11)
+ asin_c.y = lerp(asinValues[11], asinValues[12], weight.y);
+ else if (arr0y == 12)
+ asin_c.y = lerp(asinValues[12], asinValues[13], weight.y);
+ else if (arr0y == 13)
+ asin_c.y = lerp(asinValues[13], asinValues[14], weight.y);
+ else if (arr0y == 14)
+ asin_c.y = lerp(asinValues[14], asinValues[15], weight.y);
+ else if (arr0y == 15)
+ asin_c.y = lerp(asinValues[15], asinValues[16], weight.y);
+ else if (arr0y == 16)
+ asin_c.y = asinValues[16];
+
+ if (arr0z == 0)
+ asin_c.z = lerp(asinValues[0], asinValues[1], weight.z);
+ else if (arr0z == 1)
+ asin_c.z = lerp(asinValues[1], asinValues[2], weight.z);
+ else if (arr0z == 2)
+ asin_c.z = lerp(asinValues[2], asinValues[3], weight.z);
+ else if (arr0z == 3)
+ asin_c.z = lerp(asinValues[3], asinValues[4], weight.z);
+ else if (arr0z == 4)
+ asin_c.z = lerp(asinValues[4], asinValues[5], weight.z);
+ else if (arr0z == 5)
+ asin_c.z = lerp(asinValues[5], asinValues[6], weight.z);
+ else if (arr0z == 6)
+ asin_c.z = lerp(asinValues[6], asinValues[7], weight.z);
+ else if (arr0z == 7)
+ asin_c.z = lerp(asinValues[7], asinValues[8], weight.z);
+ else if (arr0z == 8)
+ asin_c.z = lerp(asinValues[8], asinValues[9], weight.z);
+ else if (arr0z == 9)
+ asin_c.z = lerp(asinValues[9], asinValues[10], weight.z);
+ else if (arr0z == 10)
+ asin_c.z = lerp(asinValues[10], asinValues[11], weight.z);
+ else if (arr0z == 11)
+ asin_c.z = lerp(asinValues[11], asinValues[12], weight.z);
+ else if (arr0z == 12)
+ asin_c.z = lerp(asinValues[12], asinValues[13], weight.z);
+ else if (arr0z == 13)
+ asin_c.z = lerp(asinValues[13], asinValues[14], weight.z);
+ else if (arr0z == 14)
+ asin_c.z = lerp(asinValues[14], asinValues[15], weight.z);
+ else if (arr0z == 15)
+ asin_c.z = lerp(asinValues[15], asinValues[16], weight.z);
+ else if (arr0z == 16)
+ asin_c.z = asinValues[16];
+
+ gl_FragColor = vec4(asin_c / M_PI + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..e49f94a085
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(asin(c) / M_PI + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..d8b6222608
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert
@@ -0,0 +1,69 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 asin_c = vec3(0.0);
+ vec3 scale = vec3(1.0);
+ vec3 sign = vec3(1.0);
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.r < 0.0)
+ {
+ sign.r = -1.0;
+ c.r *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.r += scale.r * pow(c.r, float(i)) / float(i);
+ scale.r *= float(i) / float(i + 1);
+ }
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.g < 0.0)
+ {
+ sign.g = -1.0;
+ c.g *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.g += scale.g * pow(c.g, float(i)) / float(i);
+ scale.g *= float(i) / float(i + 1);
+ }
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.b < 0.0)
+ {
+ sign.b = -1.0;
+ c.b *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.b += scale.b * pow(c.b, float(i)) / float(i);
+ scale.b *= float(i) / float(i + 1);
+ }
+
+ color = vec4(sign * asin_c / M_PI + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt
new file mode 100644
index 0000000000..c2de8233ad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+asin_001_to_006.html