| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 3 Use of this source code is governed by a BSD-style license that can be | |
| 4 found in the LICENSE file. | |
| 5 --> | |
| 6 <!DOCTYPE html> | |
| 7 <html> | |
| 8 <head> | |
| 9 <meta charset="utf-8"> | |
| 10 <title>WebGL uniformMatrix Conformance Tests</title> | |
| 11 <link rel="stylesheet" href="../resources/js-test-style.css"/> | |
| 12 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></scri
pt> | |
| 13 <script src="../resources/js-test-pre.js"></script> | |
| 14 <script src="resources/webgl-test.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() | |
| 23 { | |
| 24 gl_Position = vPosition; | |
| 25 } | |
| 26 </script> | |
| 27 | |
| 28 <script id="fshader" type="x-shader/x-fragment"> | |
| 29 uniform bool color; | |
| 30 void main() | |
| 31 { | |
| 32 gl_FragColor = vec4(float(color),0.0,0.0,1.0); | |
| 33 } | |
| 34 </script> | |
| 35 <script> | |
| 36 description("This test ensures WebGL implementations handle bool uniforms in a O
penGL ES 2.0 spec compliant way"); | |
| 37 | |
| 38 debug(""); | |
| 39 debug("NOTE: Some OpenGL drivers do not handle this correctly"); | |
| 40 debug(""); | |
| 41 debug("Checking gl.uniform1f with bool."); | |
| 42 | |
| 43 gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ],
1); | |
| 44 var loc = gl.getUniformLocation(gl.program, "color"); | |
| 45 gl.uniform1f(loc, 1); | |
| 46 glErrorShouldBe(gl, gl.NO_ERROR, | |
| 47 "should be able to set bool with gl.uniform1f"); | |
| 48 | |
| 49 debug(""); | |
| 50 successfullyParsed = true; | |
| 51 | |
| 52 </script> | |
| 53 <script src="../resources/js-test-post.js"></script> | |
| 54 | |
| 55 </body> | |
| 56 </html> | |
| OLD | NEW |