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 length 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>
24 GLSLGenerator
.runFeatureTest({
26 args
: "$(type) value",
27 baseArgs
: "value$(field)",
28 testFunc
: "$(func)($(type))",
33 "float $(func)_emu($(args)) {",
34 " return abs($(baseArgs));",
39 "float $(func)_emu($(args)) {",
41 " $(baseArgsX) * $(baseArgsX) + ",
42 " $(baseArgsY) * $(baseArgsY));",
47 "float $(func)_emu($(args)) {",
49 " $(baseArgsX) * $(baseArgsX) + ",
50 " $(baseArgsY) * $(baseArgsY) + ",
51 " $(baseArgsZ) * $(baseArgsZ));",
56 "float $(func)_emu($(args)) {",
58 " $(baseArgsX) * $(baseArgsX) + ",
59 " $(baseArgsY) * $(baseArgsY) + ",
60 " $(baseArgsZ) * $(baseArgsZ) + ",
61 " $(baseArgsW) * $(baseArgsW));",
68 " $(func)($(input).x * 8.0 - 4.0) / 4.0,",
69 " $(func)($(input).y * 8.0 - 4.0) / 4.0,",
73 " $(func)($(input).xy * 8.0 - 4.0) / 4.0,",
74 " 0, 0, 1);"].join("\n"),
76 " $(func)($(input).xyz * 8.0 - 4.0) / 4.0,",
77 " 0, 0, 1);"].join("\n"),
79 " $(func)($(input) * 8.0 - 4.0) / 4.0, 0, 0, 1);",
83 var successfullyParsed
= true;