glsl-function-ceil.html (1610B)
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 ceil 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: "ceil", 25 testFunc: "$(func)($(arg0))", 26 emuFunc: ["float $(func)_base(float value) {", 27 " float m = mod(value, 1.0);", 28 " return m != 0.0 ? (value + 1.0 - m) : value;", 29 "}"].join("\n"), 30 gridRes: 8, 31 tests: [ 32 ["$(output) = vec4(", 33 " $(func)($(input).x * 8.0 - 4.0) / 8.0 + 0.5,", 34 " $(func)($(input).y * 8.0 - 4.0) / 8.0 + 0.5,", 35 " 0,", 36 " 1);"].join("\n"), 37 ["$(output) = vec4(", 38 " $(func)($(input).xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),", 39 " 0, 1);"].join("\n"), 40 ["$(output) = vec4(", 41 " $(func)($(input).xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + ", 42 " vec3(0.5, 0.5, 0.5),", 43 " 1);"].join("\n"), 44 ["$(output) = ", 45 " $(func)($(input) * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + ", 46 " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n") 47 ] 48 }); 49 var successfullyParsed = true; 50 </script> 51 </body> 52 </html>