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>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>
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;
27 v_varying = vec4(
0.0,
0.0,
0.0,
1.0);
28 gl_Position = v_varying;
31 <script id=
"fragmentShaderVariant" type=
"text/something-not-javascript">#version
300 es
32 precision mediump float;
42 <script id=
"fragmentShaderInputInvariant" type=
"text/something-not-javascript">#version
300 es
43 precision mediump float;
45 invariant in vec4 v_varying;
53 <script id=
"fragmentShaderGlobalInvariant" type=
"text/something-not-javascript">#version
300 es
54 #pragma STDGL invariant(all)
55 precision mediump float;
65 <script type=
"application/javascript">
68 GLSLConformanceTester.runTests([
70 vShaderId:
"vertexShaderInvariant",
72 fShaderId:
"fragmentShaderGlobalInvariant",
73 fShaderSuccess: false,
75 passMsg:
"fragment shader with global invariant pragma must fail",
78 vShaderId:
"vertexShaderInvariant",
80 fShaderId:
"fragmentShaderInputInvariant",
81 fShaderSuccess: false,
83 passMsg:
"fragment shader with an input variable which is invariant must fail",