function resizeTexture(gl, tex, options, width, height, depth) {
  width = width || options.width;
  height = height || options.height;
  depth = depth || options.depth;
  var target = options.target || TEXTURE_2D;
  gl.bindTexture(target, tex);
  var level = options.level || 0;
  var internalFormat = options.internalFormat || options.format || RGBA;
  var formatType = getFormatAndTypeForInternalFormat(internalFormat);
  var format = options.format || formatType.format;
  var type;
  var src = options.src;

  if (!src) {
    type = options.type || formatType.type;
  } else if (isArrayBuffer(src) || Array.isArray(src) && typeof src[0] === 'number') {
    type = options.type || getTextureTypeForArrayType(gl, src, formatType.type);
  } else {
    type = options.type || formatType.type;
  }

  if (target === TEXTURE_CUBE_MAP) {
    for (var ii = 0; ii < 6; ++ii) {
      gl.texImage2D(TEXTURE_CUBE_MAP_POSITIVE_X + ii, level, internalFormat, width, height, 0, format, type, null);
    }
  } else if (target === TEXTURE_3D || target === TEXTURE_2D_ARRAY) {
    gl.texImage3D(target, level, internalFormat, width, height, depth, 0, format, type, null);
  } else {
    gl.texImage2D(target, level, internalFormat, width, height, 0, format, type, null);
  }
}
Resizes a texture based on the options passed in.

Note: This is not a generic resize anything function.
It's mostly used by {@link module:twgl.resizeFramebufferInfo}
It will use `options.src` if it exists to try to determine a `type`
otherwise it will assume `gl.UNSIGNED_BYTE`. No data is provided
for the texture. Texture parameters will be set accordingly

@param {WebGLRenderingContext} gl the WebGLRenderingContext
@param {WebGLTexture} tex the texture to resize
@param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set.
@param {number} [width] the new width. If not passed in will use `options.width`
@param {number} [height] the new height. If not passed in will use `options.height`
@param {number} [depth] the new depth. If not passed in will use `options.depth`
@memberOf module:twgl/textures