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=
"fragmentShaderVoid" type=
"text/something-not-javascript">
22 // fragment shader with default precision for illegal type should fail
23 precision mediump void;
26 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
30 <script id=
"fragmentShaderBool" type=
"text/something-not-javascript">
31 // fragment shader with default precision for illegal type should fail
32 precision mediump bool;
35 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
39 <script id=
"fragmentShaderVec2" type=
"text/something-not-javascript">
40 // fragment shader with default precision for illegal type should fail
41 precision mediump vec2;
44 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
48 <script id=
"fragmentShaderVec3" type=
"text/something-not-javascript">
49 // fragment shader with default precision for illegal type should fail
50 precision mediump vec3;
53 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
57 <script id=
"fragmentShaderVec4" type=
"text/something-not-javascript">
58 // fragment shader with default precision for illegal type should fail
59 precision mediump vec4;
62 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
66 <script id=
"fragmentShaderBvec2" type=
"text/something-not-javascript">
67 // fragment shader with default precision for illegal type should fail
68 precision mediump bvec2;
71 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
75 <script id=
"fragmentShaderBvec3" type=
"text/something-not-javascript">
76 // fragment shader with default precision for illegal type should fail
77 precision mediump bvec3;
80 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
84 <script id=
"fragmentShaderBvec4" type=
"text/something-not-javascript">
85 // fragment shader with default precision for illegal type should fail
86 precision mediump bvec4;
89 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
93 <script id=
"fragmentShaderIvec2" type=
"text/something-not-javascript">
94 // fragment shader with default precision for illegal type should fail
95 precision mediump ivec2;
98 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
102 <script id=
"fragmentShaderIvec3" type=
"text/something-not-javascript">
103 // fragment shader with default precision for illegal type should fail
104 precision mediump ivec3;
107 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
108 gl_FragColor = color;
111 <script id=
"fragmentShaderIvec4" type=
"text/something-not-javascript">
112 // fragment shader with default precision for illegal type should fail
113 precision mediump ivec4;
116 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
117 gl_FragColor = color;
120 <script id=
"fragmentShaderMat2" type=
"text/something-not-javascript">
121 // fragment shader with default precision for illegal type should fail
122 precision mediump mat2;
125 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
126 gl_FragColor = color;
129 <script id=
"fragmentShaderMat3" type=
"text/something-not-javascript">
130 // fragment shader with default precision for illegal type should fail
131 precision mediump mat3;
134 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
135 gl_FragColor = color;
138 <script id=
"fragmentShaderMat4" type=
"text/something-not-javascript">
139 // fragment shader with default precision for illegal type should fail
140 precision mediump mat4;
143 mediump vec4 color = vec4(
1.0,
0.0,
0.0,
1.0);
144 gl_FragColor = color;
149 GLSLConformanceTester
.runTests([
151 fShaderId
: 'fragmentShaderVoid',
152 fShaderSuccess
: false,
154 passMsg
: 'shader with default precision for void should fail'
157 fShaderId
: 'fragmentShaderBool',
158 fShaderSuccess
: false,
160 passMsg
: 'shader with default precision for bool should fail'
163 fShaderId
: 'fragmentShaderVec2',
164 fShaderSuccess
: false,
166 passMsg
: 'shader with default precision for vec2 should fail'
169 fShaderId
: 'fragmentShaderVec3',
170 fShaderSuccess
: false,
172 passMsg
: 'shader with default precision for vec3 should fail'
175 fShaderId
: 'fragmentShaderVec4',
176 fShaderSuccess
: false,
178 passMsg
: 'shader with default precision for vec4 should fail'
181 fShaderId
: 'fragmentShaderBvec2',
182 fShaderSuccess
: false,
184 passMsg
: 'shader with default precision for bvec2 should fail'
187 fShaderId
: 'fragmentShaderBvec3',
188 fShaderSuccess
: false,
190 passMsg
: 'shader with default precision for bvec3 should fail'
193 fShaderId
: 'fragmentShaderBvec4',
194 fShaderSuccess
: false,
196 passMsg
: 'shader with default precision for bvec4 should fail'
199 fShaderId
: 'fragmentShaderIvec2',
200 fShaderSuccess
: false,
202 passMsg
: 'shader with default precision for ivec2 should fail'
205 fShaderId
: 'fragmentShaderIvec3',
206 fShaderSuccess
: false,
208 passMsg
: 'shader with default precision for ivec3 should fail'
211 fShaderId
: 'fragmentShaderIvec4',
212 fShaderSuccess
: false,
214 passMsg
: 'shader with default precision for ivec4 should fail'
217 fShaderId
: 'fragmentShaderMat2',
218 fShaderSuccess
: false,
220 passMsg
: 'shader with default precision for mat2 should fail'
223 fShaderId
: 'fragmentShaderMat3',
224 fShaderSuccess
: false,
226 passMsg
: 'shader with default precision for mat3 should fail'
229 fShaderId
: 'fragmentShaderMat4',
230 fShaderSuccess
: false,
232 passMsg
: 'shader with default precision for mat4 should fail'
235 var successfullyParsed
= true;