WebGL Texture Loading Performance (v28)

Revision 28 of this benchmark created by Ivan on


Preparation HTML

<script>
  var glcanvas = document.createElement('canvas');
  var gl = glcanvas.getContext('experimental-webgl');
  
  var canvas1024 = document.createElement('canvas');
  canvas1024.width = 1024;
  canvas1024.height = 1024;
  var img1024 = new Image();
  var buff1024 = new Uint8Array(1024*1024*4);
  var id1024 = document.createElement("canvas").getContext("2d").createImageData(1024,1024);
  var tex1024 = gl.createTexture();
  img1024.onload = function() {
      gl.bindTexture(gl.TEXTURE_2D, tex1024);
      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img1024);
  };
  img1024.src = canvas1024.toDataURL();
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
texImage2D 1024
gl.bindTexture(gl.TEXTURE_2D, tex1024);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img1024);
ready
texImage2D 1024 buffer
gl.bindTexture(gl.TEXTURE_2D, tex1024);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1024, 1024, 0, gl.RGBA, gl.UNSIGNED_BYTE, buff1024);
ready
texImage2D 1024 ImageData
gl.bindTexture(gl.TEXTURE_2D, tex1024);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, id1024);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.