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

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 <!--
     2 Copyright (c) 2011 The Chromium Authors. All rights reserved.
     3 Use of this source code is governed by a BSD-style license that can be
     4 found in the LICENSE file.
     5  -->
     6 <!DOCTYPE html>
     7 <html>
     8 <head>
     9 <meta charset="utf-8">
    10   <title>GLSL reflect function test</title>
    11   <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
    12   <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
    13   <script src="../../../resources/js-test-pre.js"></script>
    14   <script src="../../resources/webgl-test.js"> </script>
    15   <script src="../../resources/webgl-test-utils.js"> </script>
    16   <script src="../../resources/glsl-generator.js"> </script>
    17 </head>
    18 <body>
    19 <div id="description"></div>
    20 <div id="console"></div>
    21 <script>
    22 GLSLGenerator.runFeatureTest({
    23   feature: "reflect",
    24   args: "$(type) I, $(type) N",
    25   baseArgs: "value$(field)",
    26   testFunc: "$(func)($(type),$(type))",
    27   simpleEmu: [
    28       "$(type) $(func)_emu($(args)) {",
    29       "   return I - 2.0 * dot(N, I) * N;",
    30       "}"].join("\n"),
    31   gridRes: 8,
    32   tests: [
    33     ["$(output) = vec4(",
    34      "    $(func)(",
    35      "        $(input).x * 2.0 - 1.0,",
    36      "        $(input).y * 2.0 - 1.0),",
    37      "    0,",
    38      "    0,",
    39      "    1);"].join("\n"),
    40     ["$(output) = vec4(",
    41      "    $(func)(",
    42      "        $(input).xy * 2.0 - 1.0,",
    43      "        $(input).yz * 2.0 - 1.0),",
    44      "    0, 1);"].join("\n"),
    45     ["$(output) = vec4(",
    46      "    $(func)(",
    47      "        $(input).xyz * 2.0 - 1.0,",
    48      "        $(input).yzw * 2.0 - 1.0),",
    49      "    1);"].join("\n"),
    50     ["$(output) = ",
    51      "    $(func)(",
    52      "        $(input).xyzw * 2.0 - 1.0,",
    53      "        $(input).yzwx * 2.0 - 1.0);"
    54     ].join("\n")
    55   ]
    56 });
    57 successfullyParsed = true;
    58 </script>
    59 </body>
    60 </html>

mercurial