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 faceforward 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({
25 feature
: "faceforward",
26 args
: "$(type) N, $(type) I, $(type) Nref",
27 baseArgs
: "value$(field)",
28 testFunc
: "$(func)($(type),$(type),$(type))",
30 "$(type) $(func)_emu($(args)) {",
31 " return dot(Nref, I) < 0.0 ? N : -N;",
37 " $(input).x * 2.0 - 1.0,",
38 " $(input).y * 2.0 - 1.0,",
39 " $(input).z * 2.0 - 1.0),",
45 " $(input).xy * 2.0 - 1.0,",
46 " $(input).yz * 2.0 - 1.0,",
47 " $(input).zw * 2.0 - 1.0),",
48 " 0, 1);"].join("\n"),
51 " $(input).xyz * 2.0 - 1.0,",
52 " $(input).yzw * 2.0 - 1.0,",
53 " $(input).zwx * 2.0 - 1.0),",
57 " $(input).xyzw * 2.0 - 1.0,",
58 " $(input).yzwx * 2.0 - 1.0,",
59 " $(input).zwxy * 2.0 - 1.0);"
63 var successfullyParsed
= true;