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>GLSL sampler with no precision qualifier test
</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=
"vshaderSamplerNoPrecision" type=
"x-shader/x-vertex">#version
300 es
21 precision mediump float;
23 uniform $(samplerType) u_sampler;
26 gl_Position = vec4(
0.0);
29 <script id=
"fshaderSamplerNoPrecision" type=
"x-shader/x-fragment">#version
300 es
30 precision mediump float;
32 out vec4 my_FragColor;
33 uniform $(samplerType) u_sampler;
36 my_FragColor = vec4(
0.0);
39 <script type=
"application/javascript">
41 description(
"ESSL3 sampler with no precision qualifier should not compile.");
43 var wtu = WebGLTestUtils;
45 var fragmentShaderTemplate = wtu.getScript('fshaderSamplerNoPrecision');
46 var vertexShaderTemplate = wtu.getScript('vshaderSamplerNoPrecision');
48 // ESSL
3.00.4 section
4.5.4 types with no predefined precision.
54 'sampler2DArrayShadow',
67 for (var i =
0; i < samplerTypes.length; ++i) {
68 var type = samplerTypes[i];
69 var vertexShaderSrc = wtu.replaceParams(vertexShaderTemplate, {'samplerType': type});
71 vShaderSource: vertexShaderSrc,
72 vShaderSuccess: false,
74 passMsg: 'Vertex shader with a ' + type + ' uniform with no precision qualifier should not compile'
76 var fragmentShaderSrc = wtu.replaceParams(fragmentShaderTemplate, {'samplerType': type});
78 fShaderSource: fragmentShaderSrc,
79 fShaderSuccess: false,
81 passMsg: 'Fragment shader with a ' + type + ' uniform with no precision qualifier should not compile'
85 GLSLConformanceTester.runTests(tests,
2);