summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt7
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag59
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html181
53 files changed, 3720 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag
new file mode 100644
index 0000000000..46ea31cf8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag
@@ -0,0 +1,33 @@
+
+/*
+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;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat2 a = mat2(1.0, 2.0, 3.0, 4.0);
+ const mat2 b = mat2(5.0, 6.0, 7.0, 8.0);
+ mat2 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert
new file mode 100644
index 0000000000..83845e66ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert
@@ -0,0 +1,33 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat2 a = mat2(1.0, 2.0, 3.0, 4.0);
+ const mat2 b = mat2(5.0, 6.0, 7.0, 8.0);
+ mat2 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag
new file mode 100644
index 0000000000..1d0cdf2824
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag
@@ -0,0 +1,37 @@
+
+/*
+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;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat3 a = mat3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+ const mat3 b = mat3(10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0,
+ 16.0, 17.0, 18.0);
+ mat3 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert
new file mode 100644
index 0000000000..a0237d63c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert
@@ -0,0 +1,37 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat3 a = mat3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+ const mat3 b = mat3(10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0,
+ 16.0, 17.0, 18.0);
+ mat3 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag
new file mode 100644
index 0000000000..28262c2fa0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag
@@ -0,0 +1,39 @@
+
+/*
+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;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ const mat4 b = mat4(17.0, 18.0, 19.0, 20.0,
+ 21.0, 22.0, 23.0, 24.0,
+ 25.0, 26.0, 27.0, 28.0,
+ 29.0, 30.0, 31.0, 32.0);
+ mat4 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert
new file mode 100644
index 0000000000..ebc80931e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert
@@ -0,0 +1,39 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ const mat4 b = mat4(17.0, 18.0, 19.0, 20.0,
+ 21.0, 22.0, 23.0, 24.0,
+ 25.0, 26.0, 27.0, 28.0,
+ 29.0, 30.0, 31.0, 32.0);
+ mat4 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag
new file mode 100644
index 0000000000..1f88596733
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag
@@ -0,0 +1,56 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert
new file mode 100644
index 0000000000..1a87e5e4f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert
@@ -0,0 +1,55 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag
new file mode 100644
index 0000000000..d827f2a666
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag
@@ -0,0 +1,53 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert
new file mode 100644
index 0000000000..4a68460ed2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert
@@ -0,0 +1,52 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag
new file mode 100644
index 0000000000..68764145ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Copy the constant matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 5.0) elms = false;
+ if(b[1][2] != 6.0) elms = false;
+ if(b[2][0] != 7.0) elms = false;
+ if(b[2][1] != 8.0) elms = false;
+ if(b[2][2] != 9.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert
new file mode 100644
index 0000000000..c4b5dbc84d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert
@@ -0,0 +1,66 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[1][0] != 8.0) elms = false;
+ if(b[1][1] != 16.0) elms = false;
+ if(b[1][2] != 32.0) elms = false;
+ if(b[2][0] != 64.0) elms = false;
+ if(b[2][1] != 128.0) elms = false;
+ if(b[2][2] != 256.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag
new file mode 100644
index 0000000000..605dc39298
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag
@@ -0,0 +1,63 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 5.0) elms = false;
+ if(a[1][2] != 6.0) elms = false;
+ if(a[2][0] != 7.0) elms = false;
+ if(a[2][1] != 8.0) elms = false;
+ if(a[2][2] != 9.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert
new file mode 100644
index 0000000000..5b66a4ff24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert
@@ -0,0 +1,62 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[1][0] != 8.0) elms = false;
+ if(a[1][1] != 16.0) elms = false;
+ if(a[1][2] != 32.0) elms = false;
+ if(a[2][0] != 64.0) elms = false;
+ if(a[2][1] != 128.0) elms = false;
+ if(a[2][2] != 256.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag
new file mode 100644
index 0000000000..c9fc9222a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag
@@ -0,0 +1,78 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Copy the constant matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[0][3] != 4.0) elms = false;
+ if(b[1][0] != 5.0) elms = false;
+ if(b[1][1] != 6.0) elms = false;
+ if(b[1][2] != 7.0) elms = false;
+ if(b[1][3] != 8.0) elms = false;
+ if(b[2][0] != 9.0) elms = false;
+ if(b[2][1] != 10.0) elms = false;
+ if(b[2][2] != 11.0) elms = false;
+ if(b[2][3] != 12.0) elms = false;
+ if(b[3][0] != 13.0) elms = false;
+ if(b[3][1] != 14.0) elms = false;
+ if(b[3][2] != 15.0) elms = false;
+ if(b[3][3] != 16.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert
new file mode 100644
index 0000000000..083f626b8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert
@@ -0,0 +1,77 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[0][3] != 8.0) elms = false;
+ if(b[1][0] != 16.0) elms = false;
+ if(b[1][1] != 32.0) elms = false;
+ if(b[1][2] != 64.0) elms = false;
+ if(b[1][3] != 128.0) elms = false;
+ if(b[2][0] != 256.0) elms = false;
+ if(b[2][1] != 512.0) elms = false;
+ if(b[2][2] != 1024.0) elms = false;
+ if(b[2][3] != 2048.0) elms = false;
+ if(b[3][0] != 4096.0) elms = false;
+ if(b[3][1] != 8192.0) elms = false;
+ if(b[3][2] != 16384.0) elms = false;
+ if(b[3][3] != 32768.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag
new file mode 100644
index 0000000000..bca12dbbed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag
@@ -0,0 +1,75 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[0][3] != 4.0) elms = false;
+ if(a[1][0] != 5.0) elms = false;
+ if(a[1][1] != 6.0) elms = false;
+ if(a[1][2] != 7.0) elms = false;
+ if(a[1][3] != 8.0) elms = false;
+ if(a[2][0] != 9.0) elms = false;
+ if(a[2][1] != 10.0) elms = false;
+ if(a[2][2] != 11.0) elms = false;
+ if(a[2][3] != 12.0) elms = false;
+ if(a[3][0] != 13.0) elms = false;
+ if(a[3][1] != 14.0) elms = false;
+ if(a[3][2] != 15.0) elms = false;
+ if(a[3][3] != 16.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert
new file mode 100644
index 0000000000..8010ab7752
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[0][3] != 8.0) elms = false;
+ if(a[1][0] != 16.0) elms = false;
+ if(a[1][1] != 32.0) elms = false;
+ if(a[1][2] != 64.0) elms = false;
+ if(a[1][3] != 128.0) elms = false;
+ if(a[2][0] != 256.0) elms = false;
+ if(a[2][1] != 512.0) elms = false;
+ if(a[2][2] != 1024.0) elms = false;
+ if(a[2][3] != 2048.0) elms = false;
+ if(a[3][0] != 4096.0) elms = false;
+ if(a[3][1] != 8192.0) elms = false;
+ if(a[3][2] != 16384.0) elms = false;
+ if(a[3][3] != 32768.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt
new file mode 100644
index 0000000000..730999d88d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt
@@ -0,0 +1,7 @@
+# this file is auto-generated. DO NOT EDIT.
+mat_001_to_008.html
+mat_009_to_016.html
+mat_017_to_024.html
+mat_025_to_032.html
+mat_033_to_040.html
+mat_041_to_046.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag
new file mode 100644
index 0000000000..a4c35d387d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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)
+{
+ mat2 m = mat2(color.rg, color.ba);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[1][0] != color.b) result = black;
+ if(m[1][1] != color.a) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert
new file mode 100644
index 0000000000..68bc1cc1b3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(gtf_Color.rg, gtf_Color.ba);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[1][0] != gtf_Color.b) result = black;
+ if(m[1][1] != gtf_Color.a) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag
new file mode 100644
index 0000000000..d4d03d3a18
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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)
+{
+ mat2 m = mat2(color.r, color.g, color.b, color.a);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[1][0] != color.b) result = black;
+ if(m[1][1] != color.a) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert
new file mode 100644
index 0000000000..204511e73c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[1][0] != gtf_Color.b) result = black;
+ if(m[1][1] != gtf_Color.a) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag
new file mode 100644
index 0000000000..de941ae60c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag
@@ -0,0 +1,56 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert
new file mode 100644
index 0000000000..7659358d4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert
@@ -0,0 +1,55 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag
new file mode 100644
index 0000000000..05630af9cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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)
+{
+ mat2 m = mat2(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert
new file mode 100644
index 0000000000..71ceb36970
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag
new file mode 100644
index 0000000000..765949d942
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag
@@ -0,0 +1,53 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert
new file mode 100644
index 0000000000..cb2b46fd2e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert
@@ -0,0 +1,52 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag
new file mode 100644
index 0000000000..b040e0b2e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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)
+{
+ mat3 m = mat3(color.rgb, color.rgb, color.rgb);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[0][2] != color.b) result = black;
+ if(m[1][0] != color.r) result = black;
+ if(m[1][1] != color.g) result = black;
+ if(m[1][2] != color.b) result = black;
+ if(m[2][0] != color.r) result = black;
+ if(m[2][1] != color.g) result = black;
+ if(m[2][2] != color.b) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert
new file mode 100644
index 0000000000..c0e79d0c3b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert
@@ -0,0 +1,32 @@
+
+/*
+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_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[0][2] != gtf_Color.b) result = black;
+ if(m[1][0] != gtf_Color.r) result = black;
+ if(m[1][1] != gtf_Color.g) result = black;
+ if(m[1][2] != gtf_Color.b) result = black;
+ if(m[2][0] != gtf_Color.r) result = black;
+ if(m[2][1] != gtf_Color.g) result = black;
+ if(m[2][2] != gtf_Color.b) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag
new file mode 100644
index 0000000000..ac54f6162d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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)
+{
+ mat3 m = mat3(color.r, color.g, color.b, color.r, color.g, color.b, color.r, color.g, color.b);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[0][2] != color.b) result = black;
+ if(m[1][0] != color.r) result = black;
+ if(m[1][1] != color.g) result = black;
+ if(m[1][2] != color.b) result = black;
+ if(m[2][0] != color.r) result = black;
+ if(m[2][1] != color.g) result = black;
+ if(m[2][2] != color.b) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert
new file mode 100644
index 0000000000..1752e5799d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert
@@ -0,0 +1,33 @@
+
+/*
+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_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.r, gtf_Color.g, gtf_Color.b);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[0][2] != gtf_Color.b) result = black;
+ if(m[1][0] != gtf_Color.r) result = black;
+ if(m[1][1] != gtf_Color.g) result = black;
+ if(m[1][2] != gtf_Color.b) result = black;
+ if(m[2][0] != gtf_Color.r) result = black;
+ if(m[2][1] != gtf_Color.g) result = black;
+ if(m[2][2] != gtf_Color.b) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag
new file mode 100644
index 0000000000..cead1e7a20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Copy the matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 5.0) elms = false;
+ if(b[1][2] != 6.0) elms = false;
+ if(b[2][0] != 7.0) elms = false;
+ if(b[2][1] != 8.0) elms = false;
+ if(b[2][2] != 9.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert
new file mode 100644
index 0000000000..2432aba504
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert
@@ -0,0 +1,65 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Copy the matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[1][0] != 8.0) elms = false;
+ if(b[1][1] != 16.0) elms = false;
+ if(b[1][2] != 32.0) elms = false;
+ if(b[2][0] != 64.0) elms = false;
+ if(b[2][1] != 128.0) elms = false;
+ if(b[2][2] != 256.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag
new file mode 100644
index 0000000000..26d9662bc8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag
@@ -0,0 +1,42 @@
+
+/*
+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)
+{
+ mat3 m = mat3(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+ if((m[0][2] != 0.0))
+ result = black;
+
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+ if((m[1][2] != 0.0))
+ result = black;
+
+ if((m[2][0] != 0.0))
+ result = black;
+ if((m[2][1] != 0.0))
+ result = black;
+ if((m[2][2] != 0.5))
+ result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert
new file mode 100644
index 0000000000..f3e846d1b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert
@@ -0,0 +1,42 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+ if((m[0][2] != 0.0))
+ result = black;
+
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+ if((m[1][2] != 0.0))
+ result = black;
+
+ if((m[2][0] != 0.0))
+ result = black;
+ if((m[2][1] != 0.0))
+ result = black;
+ if((m[2][2] != 0.5))
+ result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag
new file mode 100644
index 0000000000..f7bc3e0b8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag
@@ -0,0 +1,63 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 5.0) elms = false;
+ if(a[1][2] != 6.0) elms = false;
+ if(a[2][0] != 7.0) elms = false;
+ if(a[2][1] != 8.0) elms = false;
+ if(a[2][2] != 9.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert
new file mode 100644
index 0000000000..6fee73b959
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert
@@ -0,0 +1,62 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[1][0] != 8.0) elms = false;
+ if(a[1][1] != 16.0) elms = false;
+ if(a[1][2] != 32.0) elms = false;
+ if(a[2][0] != 64.0) elms = false;
+ if(a[2][1] != 128.0) elms = false;
+ if(a[2][2] != 256.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag
new file mode 100644
index 0000000000..44a8076999
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag
@@ -0,0 +1,57 @@
+
+/*
+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;
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+
+ sum1 += a[0][0];
+ sum2 += a[1][0];
+ sum3 += a[2][0];
+ sum4 += a[3][0];
+
+ sum1 += a[0][1];
+ sum2 += a[1][1];
+ sum3 += a[2][1];
+ sum4 += a[3][1];
+
+ sum1 += a[0][2];
+ sum2 += a[1][2];
+ sum3 += a[2][2];
+ sum4 += a[3][2];
+
+ sum1 += a[0][3];
+ sum2 += a[1][3];
+ sum3 += a[2][3];
+ sum4 += a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert
new file mode 100644
index 0000000000..2e3622f679
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ mat4 a = mat4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+ sum1 = sum1 + a[0][0];
+ sum2 = sum2 + a[1][0];
+ sum3 = sum3 + a[2][0];
+ sum4 = sum4 + a[3][0];
+
+ sum1 = sum1 + a[0][1];
+ sum2 = sum2 + a[1][1];
+ sum3 = sum3 + a[2][1];
+ sum4 = sum4 + a[3][1];
+
+ sum1 = sum1 + a[0][2];
+ sum2 = sum2 + a[1][2];
+ sum3 = sum3 + a[2][2];
+ sum4 = sum4 + a[3][2];
+
+ sum1 = sum1 + a[0][3];
+ sum2 = sum2 + a[1][3];
+ sum3 = sum3 + a[2][3];
+ sum4 = sum4 + a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag
new file mode 100644
index 0000000000..053a5739b3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag
@@ -0,0 +1,59 @@
+
+/*
+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;
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ vec4 L1 = vec4(1.0, 2.0, 3.0, 4.0);
+ vec4 L2 = vec4(5.0, 6.0, 7.0, 8.0);
+ vec4 L3 = vec4(9.0, 10.0, 11.0, 12.0);
+ vec4 L4 = vec4(13.0, 14.0, 15.0, 16.0);
+
+ mat4 a = mat4(L1,L2,L3,L4);
+
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+ sum1 = sum1 + a[0][0];
+ sum2 = sum2 + a[1][0];
+ sum3 = sum3 + a[2][0];
+ sum4 = sum4 + a[3][0];
+
+ sum1 = sum1 + a[0][1];
+ sum2 = sum2 + a[1][1];
+ sum3 = sum3 + a[2][1];
+ sum4 = sum4 + a[3][1];
+
+ sum1 = sum1 + a[0][2];
+ sum2 = sum2 + a[1][2];
+ sum3 = sum3 + a[2][2];
+ sum4 = sum4 + a[3][2];
+
+ sum1 = sum1 + a[0][3];
+ sum2 = sum2 + a[1][3];
+ sum3 = sum3 + a[2][3];
+ sum4 = sum4 + a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert
new file mode 100644
index 0000000000..c238cdcd15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert
@@ -0,0 +1,56 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ vec4 L1 = vec4(1.0, 2.0, 3.0, 4.0);
+ vec4 L2 = vec4(5.0, 6.0, 7.0, 8.0);
+ vec4 L3 = vec4(9.0, 10.0, 11.0, 12.0);
+ vec4 L4 = vec4(13.0, 14.0, 15.0, 16.0);
+
+ mat4 a = mat4(L1,L2,L3,L4);
+
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+ sum1 = sum1 + a[0][0];
+ sum2 = sum2 + a[1][0];
+ sum3 = sum3 + a[2][0];
+ sum4 = sum4 + a[3][0];
+
+ sum1 = sum1 + a[0][1];
+ sum2 = sum2 + a[1][1];
+ sum3 = sum3 + a[2][1];
+ sum4 = sum4 + a[3][1];
+
+ sum1 = sum1 + a[0][2];
+ sum2 = sum2 + a[1][2];
+ sum3 = sum3 + a[2][2];
+ sum4 = sum4 + a[3][2];
+
+ sum1 = sum1 + a[0][3];
+ sum2 = sum2 + a[1][3];
+ sum3 = sum3 + a[2][3];
+ sum4 = sum4 + a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag
new file mode 100644
index 0000000000..b36313425f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag
@@ -0,0 +1,78 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Copy the matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[0][3] != 4.0) elms = false;
+ if(b[1][0] != 5.0) elms = false;
+ if(b[1][1] != 6.0) elms = false;
+ if(b[1][2] != 7.0) elms = false;
+ if(b[1][3] != 8.0) elms = false;
+ if(b[2][0] != 9.0) elms = false;
+ if(b[2][1] != 10.0) elms = false;
+ if(b[2][2] != 11.0) elms = false;
+ if(b[2][3] != 12.0) elms = false;
+ if(b[3][0] != 13.0) elms = false;
+ if(b[3][1] != 14.0) elms = false;
+ if(b[3][2] != 15.0) elms = false;
+ if(b[3][3] != 16.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert
new file mode 100644
index 0000000000..3c06f3258d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert
@@ -0,0 +1,77 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Copy the matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[0][3] != 8.0) elms = false;
+ if(b[1][0] != 16.0) elms = false;
+ if(b[1][1] != 32.0) elms = false;
+ if(b[1][2] != 64.0) elms = false;
+ if(b[1][3] != 128.0) elms = false;
+ if(b[2][0] != 256.0) elms = false;
+ if(b[2][1] != 512.0) elms = false;
+ if(b[2][2] != 1024.0) elms = false;
+ if(b[2][3] != 2048.0) elms = false;
+ if(b[3][0] != 4096.0) elms = false;
+ if(b[3][1] != 8192.0) elms = false;
+ if(b[3][2] != 16384.0) elms = false;
+ if(b[3][3] != 32768.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag
new file mode 100644
index 0000000000..92c3f7c890
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag
@@ -0,0 +1,75 @@
+
+/*
+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
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[0][3] != 4.0) elms = false;
+ if(a[1][0] != 5.0) elms = false;
+ if(a[1][1] != 6.0) elms = false;
+ if(a[1][2] != 7.0) elms = false;
+ if(a[1][3] != 8.0) elms = false;
+ if(a[2][0] != 9.0) elms = false;
+ if(a[2][1] != 10.0) elms = false;
+ if(a[2][2] != 11.0) elms = false;
+ if(a[2][3] != 12.0) elms = false;
+ if(a[3][0] != 13.0) elms = false;
+ if(a[3][1] != 14.0) elms = false;
+ if(a[3][2] != 15.0) elms = false;
+ if(a[3][3] != 16.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert
new file mode 100644
index 0000000000..d0953158a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[0][3] != 8.0) elms = false;
+ if(a[1][0] != 16.0) elms = false;
+ if(a[1][1] != 32.0) elms = false;
+ if(a[1][2] != 64.0) elms = false;
+ if(a[1][3] != 128.0) elms = false;
+ if(a[2][0] != 256.0) elms = false;
+ if(a[2][1] != 512.0) elms = false;
+ if(a[2][2] != 1024.0) elms = false;
+ if(a[2][3] != 2048.0) elms = false;
+ if(a[3][0] != 4096.0) elms = false;
+ if(a[3][1] != 8192.0) elms = false;
+ if(a[3][2] != 16384.0) elms = false;
+ if(a[3][3] != 32768.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html
new file mode 100644
index 0000000000..e53b2780a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html
@@ -0,0 +1,231 @@
+<!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: mat_001_to_008.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",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat2_frag.frag"
+ },
+ "name": "const_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat3_frag.frag"
+ },
+ "name": "const_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat4_frag.frag"
+ },
+ "name": "const_mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat2_copy_frag.frag"
+ },
+ "name": "const_mat2_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat2_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat2_copy_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html
new file mode 100644
index 0000000000..0a3e5c1916
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html
@@ -0,0 +1,231 @@
+<!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: mat_009_to_016.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",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat3_copy_frag.frag"
+ },
+ "name": "const_mat3_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat3_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat3_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat4_copy_frag.frag"
+ },
+ "name": "const_mat4_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat4_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat4_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_frag.frag"
+ },
+ "name": "mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_frag.frag"
+ },
+ "name": "mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html
new file mode 100644
index 0000000000..9f0ef60dd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html
@@ -0,0 +1,231 @@
+<!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: mat_017_to_024.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",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_frag.frag"
+ },
+ "name": "mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_copy_frag.frag"
+ },
+ "name": "mat2_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat2_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_copy_frag.frag"
+ },
+ "name": "mat3_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat3_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_copy_frag.frag"
+ },
+ "name": "mat4_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_copy_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html
new file mode 100644
index 0000000000..58ac71f99a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html
@@ -0,0 +1,231 @@
+<!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: mat_025_to_032.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",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_float_frag.frag"
+ },
+ "name": "mat2_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat2_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_4float_frag.frag"
+ },
+ "name": "mat2_4float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat2_4float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_4float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_2vec2_frag.frag"
+ },
+ "name": "mat2_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat2_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_float_frag.frag"
+ },
+ "name": "mat3_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat3_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html
new file mode 100644
index 0000000000..93245d25f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html
@@ -0,0 +1,231 @@
+<!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: mat_033_to_040.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",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_9float_frag.frag"
+ },
+ "name": "mat3_9float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat3_9float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_9float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_3vec3_frag.frag"
+ },
+ "name": "mat3_3vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat3_3vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_3vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_4vec4_frag.frag"
+ },
+ "name": "mat4_4vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_4vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_4vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_16float_frag.frag"
+ },
+ "name": "mat4_16float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_16float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_16float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html
new file mode 100644
index 0000000000..ddb93574a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html
@@ -0,0 +1,181 @@
+<!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: mat_041_to_046.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",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array_const_mat2_frag.frag"
+ },
+ "name": "array_const_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "array_const_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "array_const_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array_const_mat3_frag.frag"
+ },
+ "name": "array_const_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "array_const_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "array_const_mat3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array_const_mat4_frag.frag"
+ },
+ "name": "array_const_mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "array_const_mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "array_const_mat4_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>