function uniformi(cacheId, programObj, varName, varValue) {
      var varLocation = curContextCache.locations[cacheId];
      if(varLocation === undef) {
        varLocation = curContext.getUniformLocation(programObj, varName);
        curContextCache.locations[cacheId] = varLocation;
      }
      // the variable won't be found if it was optimized out.
      if (varLocation !== -1) {
        if (varValue.length === 4) {
          curContext.uniform4iv(varLocation, varValue);
        } else if (varValue.length === 3) {
          curContext.uniform3iv(varLocation, varValue);
        } else if (varValue.length === 2) {
          curContext.uniform2iv(varLocation, varValue);
        } else {
          curContext.uniform1i(varLocation, varValue);
        }
      }
    }
Sets a uniform int or int array in a program object to a particular
value. Before calling this function, ensure the correct
program object has been installed as part of the current
rendering state.

On some systems, if the variable exists in the shader but isn't used,
the compiler will optimize it out and this function will fail.

@param {WebGLProgram} programObj program object returned from
createProgramObject
@param {String} varName the name of the variable in the shader
@param {int | Array} varValue either a scalar value or an Array

@returns none

@see uniformf
@see uniformMatrix