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>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>
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=
"vertexShaderSeparateInvariant" type=
"text/something-not-javascript">#version
300 es
32 precision mediump float;
38 v_varying = vec4(
0.0,
0.0,
0.0,
1.0);
39 gl_Position = v_varying;
42 <script id=
"vertexShaderGlobalInvariant" type=
"text/something-not-javascript">#version
300 es
43 #pragma STDGL invariant(all)
44 precision mediump float;
49 v_varying = vec4(
0.0,
0.0,
0.0,
1.0);
50 gl_Position = v_varying;
53 <script id=
"fragmentShaderVariant" type=
"text/something-not-javascript">#version
300 es
54 precision mediump float;
64 <script type=
"application/javascript">
67 GLSLConformanceTester.runTests([
69 vShaderId:
"vertexShaderInvariant",
71 fShaderId:
"fragmentShaderVariant",
74 passMsg:
"vertex shader with invariant varying and fragment shader with variant varying must succeed",
77 vShaderId:
"vertexShaderGlobalInvariant",
79 fShaderId:
"fragmentShaderVariant",
82 passMsg:
"vertex shader with invariant (global setting) varying and fragment shader with variant varying must succeed",
85 vShaderId:
"vertexShaderSeparateInvariant",
87 fShaderId:
"fragmentShaderVariant",
90 passMsg:
"vertex shader with invariant (separately set) varying and fragment shader with variant varying must succeed",