Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / transform_feedback / non-existent-varying.html
blob80800c2dc5834304489e79f917af318e9c517b27
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 -->
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()
23 gl_Position = vec4(position, 1);
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()
31 color = vec4(0);
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.");
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;"
42 debug("");
44 var wtu = WebGLTestUtils;
45 var gl = wtu.create3DContext(undefined, undefined, 2);
47 if (!gl) {
48 testFailed("WebGL context does not exist");
49 } else {
50 runTest("bogus");
51 runTest("gl_Bogus");
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);
66 var successfullyParsed = true;
67 </script>
68 <script src="../../js/js-test-post.js"></script>
69 </body>
70 </html>