content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-ceil.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-ceil.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +<!--
     1.5 +Copyright (c) 2011 The Chromium Authors. All rights reserved.
     1.6 +Use of this source code is governed by a BSD-style license that can be
     1.7 +found in the LICENSE file.
     1.8 + -->
     1.9 +<!DOCTYPE html>
    1.10 +<html>
    1.11 +<head>
    1.12 +<meta charset="utf-8">
    1.13 +  <title>GLSL ceil function test</title>
    1.14 +  <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
    1.15 +  <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
    1.16 +  <script src="../../../resources/js-test-pre.js"></script>
    1.17 +  <script src="../../resources/webgl-test.js"> </script>
    1.18 +  <script src="../../resources/webgl-test-utils.js"> </script>
    1.19 +  <script src="../../resources/glsl-generator.js"> </script>
    1.20 +</head>
    1.21 +<body>
    1.22 +<div id="description"></div>
    1.23 +<div id="console"></div>
    1.24 +<script>
    1.25 +GLSLGenerator.runFeatureTest({
    1.26 +  feature: "ceil",
    1.27 +  testFunc: "$(func)($(arg0))",
    1.28 +  emuFunc: ["float $(func)_base(float value) {",
    1.29 +            "  float m = mod(value, 1.0);",
    1.30 +            "  return m != 0.0 ? (value + 1.0 - m) : value;",
    1.31 +            "}"].join("\n"),
    1.32 +  gridRes: 8,
    1.33 +  tests: [
    1.34 +    ["$(output) = vec4(",
    1.35 +     "    $(func)($(input).x * 8.0 - 4.0) / 8.0 + 0.5,",
    1.36 +     "    $(func)($(input).y * 8.0 - 4.0) / 8.0 + 0.5,",
    1.37 +     "    0,",
    1.38 +     "    1);"].join("\n"),
    1.39 +    ["$(output) = vec4(",
    1.40 +     "    $(func)($(input).xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),",
    1.41 +     "    0, 1);"].join("\n"),
    1.42 +    ["$(output) = vec4(",
    1.43 +     "    $(func)($(input).xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + ",
    1.44 +     "       vec3(0.5, 0.5, 0.5),",
    1.45 +     "    1);"].join("\n"),
    1.46 +    ["$(output) = ",
    1.47 +     "    $(func)($(input) * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + ",
    1.48 +     "       vec4(0.5, 0.5, 0.5, 0.5);"].join("\n")
    1.49 +  ]
    1.50 +});
    1.51 +successfullyParsed = true;
    1.52 +</script>
    1.53 +</body>
    1.54 +</html>
    1.55 +

mercurial