Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / invalid-invariant.html
blobf0d2b46ad1954738f1aa32a53723ffe2d2714487
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>Negative tests for the use of the invariant qualifier and pragma</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-conformance-test.js"></script>
17 </head>
18 <body>
19 <div id="description"></div>
20 <div id="console"></div>
21 <script id="vertexShaderInvariant" type="text/something-not-javascript">#version 300 es
22 precision mediump float;
23 invariant out vec4 v_varying;
25 void main()
27 v_varying = vec4(0.0, 0.0, 0.0, 1.0);
28 gl_Position = v_varying;
30 </script>
31 <script id="fragmentShaderVariant" type="text/something-not-javascript">#version 300 es
32 precision mediump float;
34 in vec4 v_varying;
35 out vec4 my_color;
37 void main()
39 my_color = v_varying;
41 </script>
42 <script id="fragmentShaderInputInvariant" type="text/something-not-javascript">#version 300 es
43 precision mediump float;
45 invariant in vec4 v_varying;
46 out vec4 my_color;
48 void main()
50 my_color = v_varying;
52 </script>
53 <script id="fragmentShaderGlobalInvariant" type="text/something-not-javascript">#version 300 es
54 #pragma STDGL invariant(all)
55 precision mediump float;
57 in vec4 v_varying;
58 out vec4 my_color;
60 void main()
62 my_color = v_varying;
64 </script>
65 <script type="application/javascript">
66 "use strict";
67 description();
68 GLSLConformanceTester.runTests([
70 vShaderId: "vertexShaderInvariant",
71 vShaderSuccess: true,
72 fShaderId: "fragmentShaderGlobalInvariant",
73 fShaderSuccess: false,
74 linkSuccess: false,
75 passMsg: "fragment shader with global invariant pragma must fail",
78 vShaderId: "vertexShaderInvariant",
79 vShaderSuccess: true,
80 fShaderId: "fragmentShaderInputInvariant",
81 fShaderSuccess: false,
82 linkSuccess: false,
83 passMsg: "fragment shader with an input variable which is invariant must fail",
85 ], 2);
86 </script>
87 </body>
88 </html>