WebGL Texture Loading Performance (v29)

Revision 29 of this benchmark created on


Preparation HTML

<script>
  var glcanvas = document.createElement('canvas');
  var gl = glcanvas.getContext('webgl');
  
  var canvasHD = document.createElement('canvas');
  canvasHD.width = 1920;
  canvasHD.height = 1080;
  var imgHD = new Image();
  var buffHD = new Uint8Array(1920*1080*4);
  var idHD = document.createElement("canvas").getContext("2d").createImageData(1920,1080);
  var texHD = gl.createTexture();
  imgHD.onload = function() {
      gl.bindTexture(gl.TEXTURE_2D, texHD);
      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, imgHD);
  };
  imgHD.src = "http://i.ytimg.com/vi/qi0iLNEOxD0/maxresdefault.jpg";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
texImage2D HD
gl.bindTexture(gl.TEXTURE_2D, texHD);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, imgHD);
ready
texImage2D HD buffer
gl.bindTexture(gl.TEXTURE_2D, texHD);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1024, 1024, 0, gl.RGBA, gl.UNSIGNED_BYTE, buffHD);
ready
texImage2D HD ImageData
gl.bindTexture(gl.TEXTURE_2D, texHD);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, idHD);
ready

Revisions

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