WebGL Texture Loading Performance (v31)

Revision 31 of this benchmark created on


Preparation HTML

<script>
var glcanvas = document.createElement('canvas');
  var gl = glcanvas.getContext('webgl');
 var texHD = gl.createTexture();
function imageLoaded(i) {
gl.bindTexture(gl.TEXTURE_2D, texHD);
      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, i);
}
</script>
<img id="imgHD" onload="imageLoaded"  src="https://tctechcrunch2011.files.wordpress.com/2013/05/sf-directions-from-home.png">
<script>
  
  
  var canvasHD = document.createElement('canvas');
  canvasHD.width = 1920;
  canvasHD.height = 1080;
  var imgHD = document.getElementById("imgHD");
  var buffHD = new Uint8Array(1920*1080*4);
  var idHD = document.createElement("canvas").getContext("2d").createImageData(1920,1080);
 
  
</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.