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 Unknown Uniform Conformance Test</title> | |
11 <link rel="stylesheet" href="../../resources/js-test-style.css"/> | |
12 <script src="../../resources/desktop-gl-constants.js" type="text/javascript"></s
cript> | |
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="canvas" 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 void main() | |
30 { | |
31 gl_FragColor = vec4(1.0,0.0,0.0,1.0); | |
32 } | |
33 </script> | |
34 <script> | |
35 description("Tests that unknown uniforms don't cause errors."); | |
36 | |
37 debug(""); | |
38 debug("Canvas.getContext"); | |
39 | |
40 var gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1
], 1); | |
41 if (!gl) { | |
42 testFailed("context does not exist"); | |
43 } else { | |
44 testPassed("context exists"); | |
45 | |
46 debug(""); | |
47 | |
48 // Get the location of an unknown uniform. | |
49 var loc = gl.getUniformLocation(gl.program, "someUnknownUniform"); | |
50 assertMsg(loc === null, "location of unknown uniform should be null"); | |
51 glErrorShouldBe(gl, gl.NO_ERROR, | |
52 "there should be no error from getting an unknown uniform"); | |
53 gl.uniform1f(loc, 1); | |
54 glErrorShouldBe(gl, gl.NO_ERROR, | |
55 "there should be no error from trying to set an unknown uniform"); | |
56 } | |
57 | |
58 debug(""); | |
59 successfullyParsed = true; | |
60 | |
61 </script> | |
62 <script src="../../resources/js-test-post.js"></script> | |
63 | |
64 </body> | |
65 </html> | |
OLD | NEW |