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.
10 <meta charset=
"utf-8">
11 <title>GLSL acos function test
</title>
12 <link rel=
"stylesheet" href=
"../../../resources/js-test-style.css"/>
13 <link rel=
"stylesheet" href=
"../../../resources/glsl-feature-tests.css"/>
14 <script src=
"../../../js/js-test-pre.js"></script>
15 <script src=
"../../../js/webgl-test-utils.js"> </script>
16 <script src=
"../../../js/glsl-generator.js"> </script>
19 <div id=
"description"></div>
20 <div id=
"console"></div>
25 "const float kPI = 3.14159265358979323846;",
26 "const float kHalfPI = (kPI * 0.5);",
27 "const float k2PI = (kPI * 2.0);"
31 var kHalfPI
= Math
.PI
* 0.5;
32 var k2PI
= Math
.PI
* 2.0;
33 var acos
= Math
.acos
; // shorthand
35 GLSLGenerator
.runReferenceImageTest({
37 args
: "$(type) value",
38 testFunc
: "$(func)($(type))",
44 source
: ["$(output) = vec4(",
45 " $(func)($(input).x * 0.8) / kPI,",
46 " $(func)($(input).y * 0.8) / kPI,",
49 generator: function(x
, y
, z
, w
) {
50 return [ acos(x
* 0.8) / kPI
,
57 source
: ["$(output) = vec4(",
58 " $(func)($(input).xy * 0.8) / kPI,",
59 " 0, 1);"].join("\n"),
60 generator: function(x
, y
, z
, w
) {
61 return [ acos(x
* 0.8) / kPI
,
68 source
: ["$(output) = vec4(",
69 " $(func)($(input).xyz * 0.8) / kPI,",
71 generator: function(x
, y
, z
, w
) {
72 return [ acos(x
* 0.8) / kPI
,
79 source
: ["$(output) = ",
80 " $(func)($(input) * 0.8) / kPI;",
82 generator: function(x
, y
, z
, w
) {
83 return [ acos(x
* 0.8) / kPI
,
86 acos(w
* 0.8) / kPI
];
91 var successfullyParsed
= true;