Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
1 <!--
2 Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6 <!DOCTYPE html>
7 <html>
8 <head>
9 <meta charset="utf-8">
10 <title>GLSL asin function test</title>
11 <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
12 <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
13 <script src="../../../resources/js-test-pre.js"></script>
14 <script src="../../resources/webgl-test.js"> </script>
15 <script src="../../resources/webgl-test-utils.js"> </script>
16 <script src="../../resources/glsl-generator.js"> </script>
17 </head>
18 <body>
19 <div id="description"></div>
20 <div id="console"></div>
21 <script>
23 var piConstants = [
24 "const float kPI = 3.14159265358979323846;",
25 "const float kHalfPI = (kPI * 0.5);",
26 "const float k2PI = (kPI * 2.0);"
27 ].join("\n");
29 var kPI = Math.PI;
30 var kHalfPI = Math.PI * 0.5;
31 var k2PI = Math.PI * 2.0;
32 var asin = Math.asin; // shorthand
34 GLSLGenerator.runReferenceImageTest({
35 feature: "asin",
36 args: "$(type) value",
37 testFunc: "$(func)($(type))",
38 gridRes: 8,
39 tolerance: 2,
40 extra: piConstants,
41 tests: [
42 {
43 source: ["$(output) = vec4(",
44 " $(func)($(input).x * 0.8) / kPI + 0.5,",
45 " $(func)($(input).y * 0.8) / kPI + 0.5,",
46 " 0,",
47 " 1);"].join("\n"),
48 generator: function(x, y, z, w) {
49 return [ asin(x * 0.8) / kPI + 0.5,
50 asin(y * 0.8) / kPI + 0.5,
51 0,
52 1 ];
53 },
54 },
55 {
56 source: ["$(output) = vec4(",
57 " $(func)($(input).xy * 0.8) / kPI + 0.5,",
58 " 0, 1);"].join("\n"),
59 generator: function(x, y, z, w) {
60 return [ asin(x * 0.8) / kPI + 0.5,
61 asin(y * 0.8) / kPI + 0.5,
62 0,
63 1 ];
64 },
65 },
66 {
67 source: ["$(output) = vec4(",
68 " $(func)($(input).xyz * 0.8) / kPI + 0.5,",
69 " 1);"].join("\n"),
70 generator: function(x, y, z, w) {
71 return [ asin(x * 0.8) / kPI + 0.5,
72 asin(y * 0.8) / kPI + 0.5,
73 asin(z * 0.8) / kPI + 0.5,
74 1 ];
75 },
76 },
77 {
78 source: ["$(output) = ",
79 " $(func)($(input) * 0.8) / kPI + 0.5;",
80 ].join("\n"),
81 generator: function(x, y, z, w) {
82 return [ asin(x * 0.8) / kPI + 0.5,
83 asin(y * 0.8) / kPI + 0.5,
84 asin(z * 0.8) / kPI + 0.5,
85 asin(w * 0.8) / kPI + 0.5 ];
86 },
87 },
88 ]
89 });
90 successfullyParsed = true;
91 </script>
92 </body>
93 </html>