Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / varying-struct-inline-definition.html
blobf3ac2485e1eb94362a153852275800fca0757c7a
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>GLSL varying struct with inline definition test</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="vshader" type="x-shader/x-vertex">#version 300 es
22 in vec4 vPosition;
24 flat out struct S {
25 int field;
26 } v_s;
28 void main() {
29 v_s.field = 1;
30 gl_Position = vPosition;
32 </script>
33 <script id="fshader" type="x-shader/x-fragment">#version 300 es
34 precision highp float;
36 flat in struct S {
37 int field;
38 } v_s;
40 out vec4 my_FragColor;
42 void main() {
43 my_FragColor = vec4(1 - v_s.field, v_s.field, 0, 1);
45 </script>
46 <script type="application/javascript">
47 "use strict";
48 description();
50 GLSLConformanceTester.runRenderTests([
52 vShaderId: 'vshader',
53 vShaderSuccess: true,
54 fShaderId: 'fshader',
55 fShaderSuccess: true,
56 linkSuccess: true,
57 passMsg: 'Vertex output struct / fragment input struct with an inline definition should compile and link'
59 ], 2);
60 </script>
61 </body>
62 </html>