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 dot 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))",
33 "float $(func)_emu($(args)) {",
39 "float $(func)_emu($(args)) {",
40 " return p1.x * p2.x + p1.y * p2.y;",
45 "float $(func)_emu($(args)) {",
46 " return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z;",
51 "float $(func)_emu($(args)) {",
52 " return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z + p1.w * p2.w;",
60 " $(input).x * 8.0 - 4.0,",
61 " $(input).y * 8.0 - 4.0) / 8.0,",
68 " $(input).xy * 8.0 - 4.0,",
69 " $(input).wz * 8.0 - 4.0) / 8.0,",
70 " 0, 1);"].join("\n"),
74 " $(input).xyz * 8.0 - 4.0,",
75 " $(input).yzw * 8.0 - 4.0) / 8.0,",
79 " vec4($(input).xyz, 0) * 8.0 - 4.0,",
80 " vec4(0, $(input).wzy) * 8.0 - 4.0) / 8.0,",
85 var successfullyParsed
= true;