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 distance 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) p1, $(type) p2",
27 baseArgs
: "value$(field)",
28 testFunc
: "$(func)($(type),$(type))",
32 "float $(func)_emu($(args)) {",
33 " return abs(p1 - p2);",
38 "float $(func)_emu($(args)) {",
39 " return length(p1 - p2);",
44 "float $(func)_emu($(args)) {",
45 " return length(p1 - p2);",
50 "float $(func)_emu($(args)) {",
51 " return length(p1 - p2);",
59 " $(input).x * 8.0 - 4.0,",
60 " $(input).y * 8.0 - 4.0) / 8.0,",
67 " $(input).xy * 8.0 - 4.0,",
68 " $(input).wz * 8.0 - 4.0) / 8.0,",
69 " 0, 1);"].join("\n"),
73 " $(input).xyz * 8.0 - 4.0,",
74 " $(input).yzw * 8.0 - 4.0) / 8.0,",
78 " vec4($(input).xyz, 0) * 8.0 - 4.0,",
79 " vec4(0, $(input).wzy) * 8.0 - 4.0) / 8.0,",
84 var successfullyParsed
= true;