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.
10 <meta charset=
"utf-8">
11 <title>Invariant does not leak across shaders
</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>
18 <div id=
"description"></div>
19 <div id=
"console"></div>
20 <script id=
"InvariantVertex" type=
"x-shader/x-vertex">
21 varying vec4 v_varying;
26 gl_Position = v_varying;
29 <script id=
"InvariantFragment" type=
"x-shader/x-fragment">
30 precision mediump float;
31 invariant varying vec4 v_varying;
35 gl_FragColor = v_varying;
38 <script id=
"VertexWithVarying" type=
"x-shader/x-vertex">
39 varying vec4 v_varying;
42 gl_Position = v_varying;
45 <script type=
"text/javascript">
47 description("The use of the invariant qualifier in one shader must not affect other shaders.");
50 debug("This is a deliberate subset of conformance/glsl/misc/shaders-with-invariance.html.");
51 debug("Compared with the original tests, order of the tests is different.");
52 debug("This test covers an ANGLE bug. See crbug.com/634813.");
54 GLSLConformanceTester
.runTests([
56 vShaderId
: "InvariantVertex",
58 fShaderId
: "InvariantFragment",
61 passMsg
: "Shaders using invariant qualifier should compile and link."
64 vShaderId
: "VertexWithVarying",
66 fShaderId
: "InvariantFragment",
69 passMsg
: "vertex shader with variant varying and fragment shader with invariant varying must fail"