tor-browser

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

array-initialize-with-same-name-array.html (1287B)


      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 array initializer that references an array with the same name</title>
     12 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
     13 <script src="../../js/js-test-pre.js"></script>
     14 <script src="../../js/webgl-test-utils.js"></script>
     15 <script src="../../js/glsl-conformance-test.js"></script>
     16 </head>
     17 <body>
     18 <div id="description"></div>
     19 <div id="console"></div>
     20 <script id="fshaderInitArray" type="x-shader/x-fragment">#version 300 es
     21 precision highp float;
     22 out vec4 my_FragColor;
     23 
     24 void main()
     25 {
     26    float foo[2] = float[2](1.0, 1.0);
     27    {
     28        float foo[2] = foo;
     29        my_FragColor = vec4(0.0, foo[0], 0.0, foo[1]);
     30    }
     31 }
     32 </script>
     33 <script type="application/javascript">
     34 "use strict";
     35 description("Initializing an array with another array with the same name should work. See GLSL ES 3.00.6 section 4.2.2.");
     36 
     37 GLSLConformanceTester.runRenderTests([
     38 {
     39  fShaderId: 'fshaderInitArray',
     40  fShaderSuccess: true,
     41  linkSuccess: true,
     42  passMsg: 'Array that is initialized with an array of the same name from an outer scope'
     43 },
     44 ], 2);
     45 </script>
     46 </body>
     47 </html>