code: function setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type) {
    options = options || defaults.textureOptions;
    internalFormat = internalFormat || gl.RGBA;
    type = type || gl.UNSIGNED_BYTE;
    const target = options.target || gl.TEXTURE_2D;
    width = width || options.width;
    height = height || options.height;
    gl.bindTexture(target, tex);
    if (canGenerateMipmap(gl, width, height, internalFormat, type)) {
      gl.generateMipmap(target);
    } else {
      const filtering = canFilter(internalFormat, type) ? gl.LINEAR : gl.NEAREST;
      gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filtering);
      gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filtering);
      gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
      gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    }
  }
docs: Sets filtering or generates mips for texture based on width or height
  If width or height is not passed in uses `options.width` and//or `options.height`
  
  @param {WebGLRenderingContext} gl the WebGLRenderingContext
  @param {WebGLTexture} tex the WebGLTexture to set parameters for
  @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set.
  This is often the same options you passed in when you created the texture.
  @param {number} [width] width of texture
  @param {number} [height] height of texture
  @param {number} [internalFormat] The internalFormat parameter from texImage2D etc..
  @param {number} [type] The type parameter for texImage2D etc..
  @memberOf module:twgl/textures