title: textImage2D load 1 component texture without copy
body: <p>I'm trying to create 2D texture from an <code>ArrayBuffer</code> containing an image with 1 component. And I would like to do it without copying it into a 4 components images.
  I would to know if it's possible with both <code>webgl</code> and <code>webgl2</code> (have more hope with webgl2).</p>
  <h3>webgl 1</h3>
  <p>I tried this one</p>
  <pre><code>gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width, height, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, pixelData);
  </code></pre>
  <p>I tried with both <code>gl.LUMINANCE</code> ans <code>gl.LUMINANCE_ALPHA</code> as the docs says</p>
  <blockquote>
  <p>Each color component is a ...</p>
  </blockquote>
  <p>as opposed of <code>gl.ALPHA</code> for example where it says :</p>
  <blockquote>
  <p>Discards the red, green and blue components and reads the alpha component</p>
  </blockquote>
  <p>From that it seems clear that <code>gl.ALPHA</code> will expect a 4 component image while <code>gl.LUMINANCE</code> and <code>gl.LUMINANCE_ALPHA</code> will only expect 1 component.<br />
  But when I do the following I get an error telling me the buffer is too small. If I pass in a buffer with 4 times the size there is no error so it seems it's also expecting a 4 component image after all.</p>
  <p>I also tried with a width and height divided by 4 thinking I could outsmart the texture coord on my shader but came to the conclusion this was probably a bad idea for interpolation, or I would had to do it myself.</p>
  <h3>webgl 2</h3>
  <p>So I didn't had much expectation with webgl 1 but I was pretty sure this would be easy with webgl2. But unfortunately the following didn't work :</p>
  <pre><code>gl.texImage2D(gl.TEXTURE_2D, 0, gl.R8, this.image.width, this.image.height, 0, gl.RED, gl.UNSIGNED_BYTE, pixelData);
  </code></pre>
  <p>It's doing the exact same complain about buffer being to small and not throwing any error with a buffer 4 times bigger.</p>
  <p>So is it possible with any (or both) version or am I doomed creating a temporary image with 4 components ?</p>