tor-browser

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

non-existent-varying.html (1905B)


      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>WebGL Transform Feedback Conformance Tests</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 </head>
     16 <body>
     17 <div id="description"></div>
     18 <div id="console"></div>
     19 <script id="vshader" type="x-shader/x-vertex">#version 300 es
     20 in vec3 position;
     21 void main()
     22 {
     23    gl_Position = vec4(position, 1);
     24 }
     25 </script>
     26 <script id="fshader" type="x-shader/x-fragment">#version 300 es
     27 precision mediump float;
     28 out vec4 color;
     29 void main()
     30 {
     31    color = vec4(0);
     32 }
     33 </script>
     34 <script>
     35 "use strict";
     36 description("Test that specifying non-existent varyings for transform feedback causes the program to fail to link. This test covers an ANGLE bug.");
     37 
     38 // Spec: GLES 3.0.5 section 2.12.8:
     39 // "A program will fail to link if:"
     40 // "any variable name specified in the varyings array is not declared as an output in the vertex shader;"
     41 
     42 debug("");
     43 
     44 var wtu = WebGLTestUtils;
     45 var gl = wtu.create3DContext(undefined, undefined, 2);
     46 
     47 if (!gl) {
     48    testFailed("WebGL context does not exist");
     49 } else {
     50    runTest("bogus");
     51    runTest("gl_Bogus");
     52 }
     53 
     54 function runTest(nonExistentVaryingName) {
     55    var program = wtu.setupTransformFeedbackProgram(gl, ["vshader", "fshader"],
     56        [nonExistentVaryingName], gl.INTERLEAVED_ATTRIBS,
     57        ["position"]);
     58    var msg = "Program should fail to link when a nonexistent varying '" + nonExistentVaryingName + "' is specified for transform feedback.";
     59    if (program) {
     60        testFailed(msg);
     61    } else {
     62        testPassed(msg);
     63    }
     64 }
     65 
     66 var successfullyParsed = true;
     67 </script>
     68 <script src="../../js/js-test-post.js"></script>
     69 </body>
     70 </html>