Backed out changeset 8fc3326bce7f (bug 1943032) for causing failures at browser_tab_g...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / valid-invariant.html
bloba4fffaf06169ec1a7dc8bb1c70cb44aa4d093b62
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>Positive 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="vertexShaderSeparateInvariant" type="text/something-not-javascript">#version 300 es
32 precision mediump float;
33 out vec4 v_varying;
34 invariant v_varying;
36 void main()
38 v_varying = vec4(0.0, 0.0, 0.0, 1.0);
39 gl_Position = v_varying;
41 </script>
42 <script id="vertexShaderGlobalInvariant" type="text/something-not-javascript">#version 300 es
43 #pragma STDGL invariant(all)
44 precision mediump float;
45 out vec4 v_varying;
47 void main()
49 v_varying = vec4(0.0, 0.0, 0.0, 1.0);
50 gl_Position = v_varying;
52 </script>
53 <script id="fragmentShaderVariant" type="text/something-not-javascript">#version 300 es
54 precision mediump float;
56 in vec4 v_varying;
57 out vec4 my_color;
59 void main()
61 my_color = v_varying;
63 </script>
64 <script type="application/javascript">
65 "use strict";
66 description();
67 GLSLConformanceTester.runTests([
69 vShaderId: "vertexShaderInvariant",
70 vShaderSuccess: true,
71 fShaderId: "fragmentShaderVariant",
72 fShaderSuccess: true,
73 linkSuccess: true,
74 passMsg: "vertex shader with invariant varying and fragment shader with variant varying must succeed",
77 vShaderId: "vertexShaderGlobalInvariant",
78 vShaderSuccess: true,
79 fShaderId: "fragmentShaderVariant",
80 fShaderSuccess: true,
81 linkSuccess: true,
82 passMsg: "vertex shader with invariant (global setting) varying and fragment shader with variant varying must succeed",
85 vShaderId: "vertexShaderSeparateInvariant",
86 vShaderSuccess: true,
87 fShaderId: "fragmentShaderVariant",
88 fShaderSuccess: true,
89 linkSuccess: true,
90 passMsg: "vertex shader with invariant (separately set) varying and fragment shader with variant varying must succeed",
92 ], 2);
93 </script>
94 </body>
95 </html>