glsl-function-lessThan.html (1484B)
1 <!-- 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. 5 --> 6 7 <!DOCTYPE html> 8 <html> 9 <head> 10 <meta charset="utf-8"> 11 <title>GLSL lessThan 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> 17 </head> 18 <body> 19 <div id="description"></div> 20 <div id="console"></div> 21 <script> 22 "use strict"; 23 GLSLGenerator.runFeatureTest({ 24 feature: "lessThan", 25 args: "$(type) x, $(type) y", 26 bvecTest: true, 27 baseArgs: "x, y", 28 testFunc: "$(func)($(type), $(type))", 29 emuFunc: ["bool $(func) _base(float x, float y) {", 30 " return x < y;", 31 "}"].join("\n"), 32 gridRes: 8, 33 tests: [ 34 ["bvec2 r = bvec2($(func)($(input).xy, $(input).yw));", 35 "$(output) = vec4(", 36 " r.x ? 0.2: 0.8,", 37 " r.y ? 0.2: 0.8,", 38 " 0, 1);"].join("\n"), 39 ["$(output) = vec4(", 40 " $(func)($(input).xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + ", 41 " vec3(0.5, 0.5, 0.5),", 42 " 1);"].join("\n"), 43 ["$(output) = ", 44 " $(func)($(input) * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + ", 45 " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n") 46 ] 47 }); 48 var successfullyParsed = true; 49 </script> 50 </body> 51 </html>