Bug 1918529 - fix some subpixel misalignment issues with gfx.webrender.svg-filter...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance / glsl / bugs / vector-scalar-arithmetic-inside-loop-complex.html
blob3b1277c1be2c692c1af11c6cb97445f4d46b134d
1 <!--
2 Copyright (c) 2019 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
5 -->
7 <!DOCTYPE html>
8 <html>
9 <head>
10 <meta charset="utf-8">
11 <title>GLSL vector/scalar arithmetic inside a for loop (complex cases)</title>
12 <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
13 <script src="../../../js/js-test-pre.js"></script>
14 <script src="../../../js/webgl-test-utils.js"></script>
15 <script src="../../../js/glsl-conformance-test.js"></script>
16 </head>
17 <body>
18 <div id="description"></div>
19 <div id="console"></div>
20 <script id="fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop" type="x-shader/x-fragment">
21 precision mediump float;
23 void main() {
24 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
25 for (int i = 0; i < 2; i++)
27 float x = gl_FragCoord.x;
28 float y = (x *= 2.0);
29 gl_FragColor = gl_FragColor + vec4(y, y, y, y);
31 if (gl_FragColor.g == gl_FragColor.r &&
32 gl_FragColor.b == gl_FragColor.r &&
33 gl_FragColor.a == gl_FragColor.r)
35 gl_FragColor = vec4(0, 1, 0, 1);
38 </script>
39 <script id="fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop2" type="x-shader/x-fragment">
40 precision mediump float;
42 void main() {
43 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
44 for (int i = 0; i < 2; i++)
46 float x = gl_FragCoord.x;
47 float y = (x *= 2.0);
48 gl_FragColor = gl_FragColor + vec4(x, y, x, y);
50 if (gl_FragColor.g == gl_FragColor.r &&
51 gl_FragColor.b == gl_FragColor.r &&
52 gl_FragColor.a == gl_FragColor.r)
54 gl_FragColor = vec4(0, 1, 0, 1);
57 </script>
58 <script type="text/javascript">
59 "use strict";
60 description();
62 // See http://crbug.com/772651
64 GLSLConformanceTester.runRenderTests([
66 fShaderId: 'fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop',
67 fShaderSuccess: true,
68 linkSuccess: true,
69 passMsg: "Adding a vector that's just 4 copies of a scalar to another vector inside for loop should work."
72 fShaderId: 'fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop2',
73 fShaderSuccess: true,
74 linkSuccess: true,
75 passMsg: "Adding a vector that's just 4 copies of a scalar stored in two different variables to another vector inside for loop should work."
77 ]);
78 </script>
79 </body>
80 </html>