function createInstanceFloatBufferDynamicDraw(gl, _ref2) {
    var attributeLoc = _ref2.attributeLoc,
      maxInstances = _ref2.maxInstances,
      size = _ref2.size;
    var dataArray = new Float32Array(maxInstances * size);
    var buffer = gl.createBuffer();
    var stride = size * 4; // num elements * 4 bytes (float)

    gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
    gl.bufferData(gl.ARRAY_BUFFER, maxInstances * stride, gl.DYNAMIC_DRAW);
    gl.enableVertexAttribArray(attributeLoc);
    gl.vertexAttribPointer(attributeLoc, size, gl.FLOAT, false, stride, 0);
    gl.vertexAttribDivisor(attributeLoc, 1);
    gl.bindBuffer(gl.ARRAY_BUFFER, null);
    buffer.dataArray = dataArray;
    buffer.stride = stride;
    buffer.size = size;
    buffer.setDataAt = function (data, i) {
      dataArray.set(data, i * size);
    };
    buffer.bufferSubData = function (count) {
      gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
      if (count) {
        gl.bufferSubData(gl.ARRAY_BUFFER, 0, dataArray, 0, count * size);
      } else {
        gl.bufferSubData(gl.ARRAY_BUFFER, 0, dataArray);
      }
    };
    return buffer;
  }
Creates a float buffer with gl.DYNAMIC_DRAW.
The returned buffer object contains functions to easily set instance data
and buffer the data before a draw call.
@param {WebGLRenderingContext} gl