summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert47
10 files changed, 345 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt
new file mode 100644
index 0000000000..91d20c86eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+matrixCompMult_001_to_004.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html
new file mode 100644
index 0000000000..ad6c1d3cdd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html
@@ -0,0 +1,83 @@
+<!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: matrixCompMult_001_to_004.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat2_frag.frag"
+ },
+ "name": "matrixMultComp_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "matrixMultComp_mat2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "matrixMultComp_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "matrixMultComp_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat3_frag.frag"
+ },
+ "name": "matrixMultComp_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "matrixMultComp_mat3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "matrixMultComp_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "matrixMultComp_mat3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag
new file mode 100644
index 0000000000..f8e6b692bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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 m1 = mat2(color.rg, color.ba);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3 = matrixCompMult(m1, m2);
+ gl_FragColor = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag
new file mode 100644
index 0000000000..5c482c354c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.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 m1 = mat2(color.rg, color.ba);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+
+ gl_FragColor = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert
new file mode 100644
index 0000000000..8dcb323df9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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 m1 = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3 = matrixCompMult(m1, m2);
+ color = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert
new file mode 100644
index 0000000000..949181a180
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert
@@ -0,0 +1,27 @@
+
+/*
+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 m1 = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+
+ color = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag
new file mode 100644
index 0000000000..823478c2c3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag
@@ -0,0 +1,36 @@
+
+/*
+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 m1 = mat3(color.rgb, color.rgb, color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3 = matrixCompMult(m1, m2);
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ gl_FragColor = vec4(result / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag
new file mode 100644
index 0000000000..6b10418621
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.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 m1 = mat3(color.rgb, color.rgb, color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[0][2] = m1[0][2] * m2[0][2];
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+ m3[1][2] = m1[1][2] * m2[1][2];
+ m3[2][0] = m1[2][0] * m2[2][0];
+ m3[2][1] = m1[2][1] * m2[2][1];
+ m3[2][2] = m1[2][2] * m2[2][2];
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ gl_FragColor = vec4(result / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert
new file mode 100644
index 0000000000..82825a3030
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_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_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m1 = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3 = matrixCompMult(m1, m2);
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ color = vec4(result / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert
new file mode 100644
index 0000000000..8d4c68cd34
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert
@@ -0,0 +1,47 @@
+
+/*
+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 m1 = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[0][2] = m1[0][2] * m2[0][2];
+
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+ m3[1][2] = m1[1][2] * m2[1][2];
+
+ m3[2][0] = m1[2][0] * m2[2][0];
+ m3[2][1] = m1[2][1] * m2[2][1];
+ m3[2][2] = m1[2][2] * m2[2][2];
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ color = vec4(result / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}