Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / sampler-no-precision.html
blob8205fa5c256f33c4ac19e21e5324e9b106242a03
1 <!--
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.
5 -->
7 <!DOCTYPE html>
8 <html>
9 <head>
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>
16 </head>
17 <body>
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;
25 void main() {
26 gl_Position = vec4(0.0);
28 </script>
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;
35 void main() {
36 my_FragColor = vec4(0.0);
38 </script>
39 <script type="application/javascript">
40 "use strict";
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.
49 var samplerTypes = [
50 'sampler3D',
51 'samplerCubeShadow',
52 'sampler2DShadow',
53 'sampler2DArray',
54 'sampler2DArrayShadow',
55 'isampler2D',
56 'isampler3D',
57 'isamplerCube',
58 'isampler2DArray',
59 'usampler2D',
60 'usampler3D',
61 'usamplerCube',
62 'usampler2DArray'
65 var tests = [];
67 for (var i = 0; i < samplerTypes.length; ++i) {
68 var type = samplerTypes[i];
69 var vertexShaderSrc = wtu.replaceParams(vertexShaderTemplate, {'samplerType': type});
70 tests.push({
71 vShaderSource: vertexShaderSrc,
72 vShaderSuccess: false,
73 linkSuccess: false,
74 passMsg: 'Vertex shader with a ' + type + ' uniform with no precision qualifier should not compile'
75 });
76 var fragmentShaderSrc = wtu.replaceParams(fragmentShaderTemplate, {'samplerType': type});
77 tests.push({
78 fShaderSource: fragmentShaderSrc,
79 fShaderSuccess: false,
80 linkSuccess: false,
81 passMsg: 'Fragment shader with a ' + type + ' uniform with no precision qualifier should not compile'
82 });
85 GLSLConformanceTester.runTests(tests, 2);
86 </script>
87 </body>
88 </html>