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 mod-float 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>
23 GLSLGenerator
.runFeatureTest({
25 args
: "$(type) value, float divisor",
26 baseArgs
: "value$(field), divisor",
27 testFunc
: "$(func)($(arg0), float)",
29 emuFunc
: ["float $(func)_base(float value, float divisor) {",
30 " return value - divisor * floor(value / divisor);",
35 " $(func)($(input).x * 6.0 - 3.0, 1.5) / 1.5,",
36 " $(func)($(input).y * 6.0 - 3.0, 1.5) / 1.5,",
40 " $(func)($(input).xy * 6.0 - vec2(3, 3), 1.5) / 1.5,",
41 " 0, 1);"].join("\n"),
43 " $(func)($(input).xyz * 6.0 - vec3(3, 3, 3), 1.5) / 1.5,",
46 " $(func)($(input) * 6.0 - vec4(3, 3, 3, 3), 1.5) / 1.5;"].join("\n")
49 var successfullyParsed
= true;