Backed out changeset b462e7b742d8 (bug 1908261) for causing multiple reftest failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance / uniforms / gl-uniform-bool.html
blob4f23cb4cf4d306ffca954d1e63e2802b9078a6ad
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>WebGL uniformMatrix Conformance Tests</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 </head>
16 <body>
17 <div id="description"></div>
18 <div id="console"></div>
19 <canvas id="example" width="2" height="2"> </canvas>
20 <script id="vshader" type="x-shader/x-vertex">
21 attribute vec4 vPosition;
22 void main()
24 gl_Position = vPosition;
26 </script>
28 <script id="fshader" type="x-shader/x-fragment">
29 uniform bool color;
30 void main()
32 gl_FragColor = vec4(float(color),0.0,0.0,1.0);
34 </script>
35 <script>
36 "use strict";
37 description("This test ensures WebGL implementations handle bool uniforms in a OpenGL ES 2.0 spec compliant way");
39 debug("");
40 debug("NOTE: Some OpenGL drivers do not handle this correctly");
41 debug("");
42 debug("Checking gl.uniform1f with bool.");
44 var wtu = WebGLTestUtils;
45 var gl = wtu.create3DContext("example");
46 var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
47 var loc = gl.getUniformLocation(program, "color");
48 gl.uniform1f(loc, 1);
49 wtu.glErrorShouldBe(gl, gl.NO_ERROR,
50 "should be able to set bool with gl.uniform1f");
52 debug("");
53 var successfullyParsed = true;
55 </script>
56 <script src="../../js/js-test-post.js"></script>
58 </body>
59 </html>