We are profiling our application and we're noticing that most of the cpu time is spent on calls to texImage2D which is what we use to populate a texture. An example is shown below. I'd like to know if there are faster methods available in WebGL 1/2 or propriatary browser extensions that make this faster?
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D,
0,
0,
0,
width,
height,
gl.RED,
gl.FLOAT,
data);
gl.bindTexture(gl.TEXTURE_2D, null);