function uniformMatrix(cacheId, programObj, varName, transpose, matrix) {
      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 (matrix.length === 16) {
          curContext.uniformMatrix4fv(varLocation, transpose, matrix);
        } else if (matrix.length === 9) {
          curContext.uniformMatrix3fv(varLocation, transpose, matrix);
        } else {
          curContext.uniformMatrix2fv(varLocation, transpose, matrix);
        }
      }
    }
Sets the value of a uniform matrix variable in a program
object. 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 {boolean} transpose must be false
@param {Array} matrix an array of 4, 9 or 16 values

@returns none

@see uniformi
@see uniformf