code: function getSamplerSetFunction( type, location, gl, context ){
    var unit = context.texIndex++;
    return function(){
      if( arguments.length === 1 ) {
        if( arguments[0].bind !== undefined ){ // is texture
          arguments[0].bind( unit );
          gl.uniform1i( location, unit );
        } else {
          gl.uniform1i( location, arguments[0] );
        }
      }
      return location;
    };
  }
docs: /*
  setter factory for sampler uniforms