3 <script src=
"../../../resources/js-test.js"></script>
4 <script src=
"resources/webgl-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
12 description('Tests passing a vec4 to a uniform and a canvas to texImage2D');
14 var gl
= create3DContext();
15 var floatProgram
= loadProgram(gl
, "resources/floatUniformShader.vert", "resources/noopUniformShader.frag");
16 shouldBeUndefined("gl.useProgram(floatProgram)");
17 var fval4Loc
= gl
.getUniformLocation(floatProgram
, "fval4");
18 shouldBe("gl.getError()", "gl.NO_ERROR");
19 shouldBeUndefined("gl.uniform4fv(fval4Loc, new Float32Array([0.1, 0.2, 0.4, 1.0]));");
21 var tmpcanvas
= document
.createElement("canvas");
24 var texture
= gl
.createTexture();
25 shouldBeUndefined("gl.bindTexture(gl.TEXTURE_2D, texture)");
26 shouldBeUndefined("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tmpcanvas)");