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>WebGL GLSL Conformance Tests
</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=
"fshaderWithMediumpGlobal" type=
"text/something-not-javascript">
22 // There is no default float precision in fragment shaders, so specify mediump.
23 precision mediump float;
32 <script id=
"fshaderWithMediumpGlobalInt" type=
"text/something-not-javascript">
33 // Default precision for int in fragment shaders is mediump.
38 gl_FragColor = vec4(foo,
0,
0,
1);
41 <script id=
"fshaderWithMediumpGlobalStruct" type=
"text/something-not-javascript">
42 // There is no default float precision in fragment shaders, so specify mediump.
43 precision mediump float;
54 gl_FragColor = baz.bar;
57 <script id=
"vshaderWithHighpGlobal" type=
"x-shader/x-vertex">
58 // Default precision for vertex shaders is highp.
65 <script id=
"vshaderWithHighpGlobalInt" type=
"x-shader/x-vertex">
66 // Default precision for int in vertex shaders is highp.
70 gl_Position = vec4(foo,
0,
0,
1);
73 <script id=
"vshaderWithHighpGlobalStruct" type=
"x-shader/x-vertex">
74 // Default precision for vertex shaders is highp.
84 gl_Position = baz.bar;
89 description("Checks shaders with global variables and precision qualifier mismatch.");
91 var wtu
= WebGLTestUtils
;
96 vShaderId
: 'vshaderWithHighpGlobal',
98 fShaderId
: 'fshaderWithMediumpGlobal',
101 passMsg
: "mismatching precision for uniforms causes link error (as expected)",
105 vShaderId
: 'vshaderWithHighpGlobalInt',
106 vShaderSuccess
: true,
107 fShaderId
: 'fshaderWithMediumpGlobalInt',
108 fShaderSuccess
: true,
110 passMsg
: "mismatching precision for int uniforms with default precision causes link error (as expected)",
114 vShaderId
: 'vshaderWithHighpGlobalStruct',
115 vShaderSuccess
: true,
116 fShaderId
: 'fshaderWithMediumpGlobalStruct',
117 fShaderSuccess
: true,
119 passMsg
: "mismatching precision for structure uniforms causes link error (as expected)",
122 GLSLConformanceTester
.runTests(glslTests
);
125 var successfullyParsed
= true;