1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>WebGL uniformMatrix Conformance Tests</title>
7 <link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
8 <script src="../../js/resources/js-test-pre.js"></script>
9 <script src="resources/webgl-test.js"></script>
10 <script src="resources/utils3d.js"></script>
13 <div id="description"></div>
14 <div id="console"></div>
15 <canvas id="example" width="2" height="2"> </canvas>
17 <script id="vshader" type="x-shader/x-vertex">
18 attribute vec4 vPosition;
24 gl_Position = vec4(vPosition.xyz, world3[0].x + world2[0].x) * world4;
28 <script id="fshader" type="x-shader/x-fragment">
31 gl_FragColor = vec4(1.0,0.0,0.0,1.0);
36 description("This test ensures WebGL implementations handle uniformMatrix in a OpenGL ES 2.0 spec compliant way");
39 debug("Checking gl.uniformMatrix.");
41 gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
42 for (var ii = 2; ii <= 4; ++ii) {
43 var loc = gl.getUniformLocation(gl.program, "world" + ii);
45 for (var jj = 0; jj < ii; ++jj) {
46 for (var ll = 0; ll < ii; ++ll) {
47 if (jj == ii -1 && ll == ii - 1)
49 mat[jj * ii + ll] = (jj == ll) ? 1 : 0;
52 name = "uniformMatrix" + ii + "fv";
53 gl[name](loc, false, mat);
54 assertMsg(gl.getError() == gl.INVALID_VALUE, "should fail with insufficient array size for " + name);
56 gl[name](loc, false, mat);
57 assertMsg(gl.getError() == gl.NO_ERROR, "can call " + name + "with transpose = false");
58 gl[name](loc, true, mat);
59 assertMsg(gl.getError() == gl.INVALID_VALUE, name + " should return INVALID_VALUE with transpose = true");
63 successfullyParsed = true;
66 <script src="../../js/resources/js-test-post.js"></script>