diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
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; +} |