function createUniformBlockInfoFromProgram(gl, program, uniformBlockSpec, blockName) {
    var blockSpecs = uniformBlockSpec.blockSpecs;
    var uniformData = uniformBlockSpec.uniformData;
    var blockSpec = blockSpecs[blockName];
    if (!blockSpec) {
      warn("no uniform block object named:", blockName);
      return {
        name: blockName,
        uniforms: {},
      };
    }
    var array = new ArrayBuffer(blockSpec.size);
    var buffer = gl.createBuffer();
    var uniformBufferIndex = blockSpec.index;
    gl.bindBuffer(gl.UNIFORM_BUFFER, buffer);
    gl.uniformBlockBinding(program, blockSpec.index, uniformBufferIndex);

    var prefix = blockName + ".";
    if (arraySuffixRE.test(prefix)) {
      prefix = prefix.replace(arraySuffixRE, ".");
    }
    var uniforms = {};
    blockSpec.uniformIndices.forEach(function(uniformNdx) {
      var data = uniformData[uniformNdx];
      var typeInfo = typeMap[data.type];
      var Type = typeInfo.Type;
      var length = data.size * typeInfo.size;
      var name = data.name;
      if (name.substr(0, prefix.length) === prefix) {
        name = name.substr(prefix.length);
      }
      uniforms[name] = new Type(array, data.offset, length / Type.BYTES_PER_ELEMENT);
    });
    return {
      name: blockName,
      array: array,
      asFloat: new Float32Array(array),  // for debugging
      buffer: buffer,
      uniforms: uniforms,
    };
  }
Creates a `UniformBlockInfo` for the specified block

Note: **If the blockName matches no existing blocks a warning is printed to the console and a dummy
`UniformBlockInfo` is returned**. This is because when debugging GLSL
it is common to comment out large portions of a shader or for example set
the final output to a constant. When that happens blocks get optimized out.
If this function did not create dummy blocks your code would crash when debugging.

@param {WebGL2RenderingContext} gl A WebGL2RenderingContext
@param {WebGLProgram} program A WebGLProgram
@param {module:twgl.UniformBlockSpec} uinformBlockSpec. A UniformBlockSpec as returned
    from {@link module:twgl.createUniformBlockSpecFromProgram}.
@param {string} blockName The name of the block.
@return {module:twgl.UniformBlockInfo} The created UniformBlockInfo
@memberOf module:twgl/programs