uniformMatrixNfv.html (1009B)
1 <!doctype html> 2 <title>uniformMatrix*fv</title> 3 <link rel=author href=mailto:Ms2ger@gmail.com title=Ms2ger> 4 <link rel=help href=https://www.khronos.org/registry/webgl/specs/latest/#WebGLRenderingContext> 5 <link rel=help href=http://dev.w3.org/2006/webapi/WebIDL/#es-boolean> 6 <link rel=help href=http://es5.github.com/#x9.2> 7 <script src=/resources/testharness.js></script> 8 <script src=/resources/testharnessreport.js></script> 9 <script src=common.js></script> 10 11 <div id=log></div> 12 <script id="vshader" type="x-shader/x-vertex"> 13 uniform mat2 m2; 14 uniform mat3 m3; 15 uniform mat4 m4; 16 </script> 17 <script> 18 var floatArray = function(n) { 19 var a = []; 20 for (var i = 0; i < n; ++i) { 21 a.push(1); 22 } 23 return a; 24 }; 25 [2, 3, 4].forEach(function(n) { 26 test(function() { 27 var gl = getGl(); 28 var f = "uniformMatrix" + n + "fv"; 29 var loc = gl.getUniformLocation(gl.createProgram(), "m" + n); 30 gl[f](loc, { valueOf: function() { throw "Error"; } }, floatArray(n)); 31 }, "Should not throw for " + n); 32 }); 33 </script>