tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

glsl-function-reflect.html (1666B)


      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 reflect 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: "reflect",
     25  args: "$(type) I, $(type) N",
     26  baseArgs: "value$(field)",
     27  testFunc: "$(func)($(type),$(type))",
     28  simpleEmu: [
     29      "$(type) $(func)_emu($(args)) {",
     30      "   return I - 2.0 * dot(N, I) * N;",
     31      "}"].join("\n"),
     32  gridRes: 8,
     33  tests: [
     34    ["$(output) = vec4(",
     35     "    $(func)(",
     36     "        $(input).x * 2.0 - 1.0,",
     37     "        $(input).y * 2.0 - 1.0),",
     38     "    0,",
     39     "    0,",
     40     "    1);"].join("\n"),
     41    ["$(output) = vec4(",
     42     "    $(func)(",
     43     "        $(input).xy * 2.0 - 1.0,",
     44     "        $(input).yz * 2.0 - 1.0),",
     45     "    0, 1);"].join("\n"),
     46    ["$(output) = vec4(",
     47     "    $(func)(",
     48     "        $(input).xyz * 2.0 - 1.0,",
     49     "        $(input).yzw * 2.0 - 1.0),",
     50     "    1);"].join("\n"),
     51    ["$(output) = ",
     52     "    $(func)(",
     53     "        $(input).xyzw * 2.0 - 1.0,",
     54     "        $(input).yzwx * 2.0 - 1.0);"
     55    ].join("\n")
     56  ]
     57 });
     58 var successfullyParsed = true;
     59 </script>
     60 </body>
     61 </html>